You can enable schedule backup of koha database with the help of cron job feature in Ubuntu. Cron is a system daemon used to execute desired tasks (in the background) at designated times.You can read more about cron in Ubuntu here.
In this process we put a mysql command to take backup of Koha database in every 60 minutes.
Create a folder in home folder called "backup", where backup file store.
Open Applications > Accessories > Terminal
Apply the following command,
crontab -e
It will ask to select a text editor. You can select Nano text editor.
You can see crontab file content. Use down arrow button and move the cursor to bottom part of the cron file. Copy following command there.
*/60 * * * * mysqldump -ukoha_library -pkoha123 koha_library | xz > /home/koha/backup/koha_library.sql.xz
Run backup command in a specific time
15 16 * * * mysqldump -ukoha_library -pkoha123 koha_library | xz > /home/koha/backup/koha_library.sql.xz
Above mentioned command take a backup at 3:15 PM every day.
Apply Ctrl + o button to save the file.
Then apply Ctrl + x to leave the cron.
You can find backup file in /home/koha/backup folder after 60 minutes.
Explanations of key parts in the command,
-u koha_library = MySQL Koha Database username
-p koha123 = password of Koha Database
koha_library = Koha database name
XZ = compression format.
In this process we put a mysql command to take backup of Koha database in every 60 minutes.
Create a folder in home folder called "backup", where backup file store.
Open Applications > Accessories > Terminal
Apply the following command,
crontab -e
It will ask to select a text editor. You can select Nano text editor.
You can see crontab file content. Use down arrow button and move the cursor to bottom part of the cron file. Copy following command there.
*/60 * * * * mysqldump -ukoha_library -pkoha123 koha_library | xz > /home/koha/backup/koha_library.sql.xz
Run backup command in a specific time
15 16 * * * mysqldump -ukoha_library -pkoha123 koha_library | xz > /home/koha/backup/koha_library.sql.xz
Above mentioned command take a backup at 3:15 PM every day.
Apply Ctrl + o button to save the file.
Then apply Ctrl + x to leave the cron.
You can find backup file in /home/koha/backup folder after 60 minutes.
Explanations of key parts in the command,
-u koha_library = MySQL Koha Database username
-p koha123 = password of Koha Database
koha_library = Koha database name
XZ = compression format.
thank you very much sir..
ReplyDeleteThank you sir
ReplyDeletevery useful
ReplyDeleteThanks so much
ReplyDeleteVery Useful , Thank you sir
ReplyDeleteVery Useful . Thank You sir
ReplyDelete-u root = MySQL root user name
ReplyDelete-p mysqlroot = password of MySQL root user.
koha_library = Koha database name
what is purpose of above commands sir ? please explain .. thanks in advance!
Sir Libsys backup how to import in koha
ReplyDeleteLibsys previous version has marc export facility.
DeleteDear Vimal,
ReplyDeleteI have a same query: How to use the backup of LibSys in Koha?
How to take backup for specific branch library(ies) in Koha?
ReplyDeleteI am not sure. Please ask in Koha discussion forum.
DeleteThanki you...
Delete