How to take Automatic Backup of Koha database in Dropbox

Koha backup 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). Now a Dropbox folder will be created in the home directory of your Linux machine. Now you need to set a crontab to store a koha backup in the dropbox folder.

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

sudo su 

Hit Enter and enter the root password

Now Apply the following command to open crontab

crontab -e

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