How to take Automatic Backup of Koha database in Dropbox

Dropbox is a file hosting service that provides Two GB of free cloud storage and file synchronization. It allows the user to create a folder on their computer, which after synchronization can be accessed by the user on any device (computers, Smartphones through the mobile app) along with the content. It is very easy to take an automatic backup of the koha database in Dropbox.

Install the Dropbox app on your production machine

Create an account in Dropbox (If already created then you can use your existing account)

Open the terminal (Applications > System Tools > Terminal (ctrl+alt+t) and login as root user

sudo su 

Hit Enter and password

Now Apply the following command to open crontab:-

crontab -e

Choose the '1' to open the configuration file with the nano editor

Use the down arrow button, and move the cursor to the bottom of the file

Copy and Paste the following lines in the last (bottom) of the file

Backup every 60 Minutes

*/60 * * * * mysqldump -ukoha_library -proot koha_library | xz > /home/koha/Dropbox/koha_library.sql.xz

Backup at 6.30 PM Everyday 

30 18 * * * mysqldump -ukoha_library -proot koha_library | xz > /home/koha/Dropbox/koha_library.sql.xz

Change the (koha_library) database user name, (root) Koha database password, and (koha_library) Koha database name as per your koha credentials. And don't forget to locate the correct location path (/home/koha/Dropbox) of your dropbox folder.

save and close the file

You can find the backup file in the /home/koha/Dropbox folder.

With the login credentials, you can check backup anywhere on the Dropbox website through the internet and the Dropbox mobile app.

Post a Comment

0 Comments