How to Auto Backup Koha & inout Databases using a Script
This is a simple script that is used for backing up both koha_library & inout databases to Dropbox with automatic deletion of old backup files.
Create account.
Create an account on the website of any cloud storage service provider that offers free space, make sure that, its client applications are available for Debian/Ubuntu Linux. Following are the popular cloud storage providers that offer their client applications in Linux, I prefer Dropbox for this tutorial, you can choose any one of them.
- 1. Dropbox
- 2. MEGA
- 3. Google Drive
- Create directories.
- mkdir Dropbox/{koha-backups,inout-backups}
- Download the shell script Download backup.sh
Copy the shell script to the home folder. Open the shell script and make changes to the Koha database, username, password and location of the backup. The timestamp of the database also appears on the backup file name. Give the number of days the backup keep.
Move the shell script to /usr/local/bin
sudo cp backup.sh /usr/local/bin
Give the necessary permission to the shell script.
sudo chmod +x /usr/local/bin/backup.sh
crontab -e
#Koha backup & Inout backup
00 17 * * * /usr/local/bin/backup.sh
No comments:
Post a Comment