(Dropbox provides 2 GB of cloud storage that lets you save files online and sync them to your devices. After installation of the Dropbox app, A dropbox folder appears in the home directory of your Linux machine. We can add the files, and folders in the dropbox folder, which can be accessed from anywhere through the Dropbox account)
Let us know how to set a crontab to take scheduled backups of Dspace in dropbox (Cloud storage)
Install the Dropbox app on your Ubuntu machine. Create or log in with your account credentials. Now you will find a Dropbox directory in the home directory of your Linux machine. We have to set a crontab to take scheduled backups in the Dropbox folder. Deposited backup in a Dropbox folder can be accessed from anywhere using a Dropbox account.
Take Backup in Dropbox using bash script:-
Open the terminal
sudo su (Hit Enter)
Enter the Password
Change the permission of the Dropbox folder
sudo chmod 777 Dropbox
Create a bash script file in the Dropbox Directory for scheduled backup
sudo gedit Dropbox/backup.sh
Add the following lines to the file
#!/bin/bash
PGPASSWORD="dspace" pg_dump -U dspace -h localhost -Fc dspace | gzip > backup_dspace/dspace-$(date +%Y-%m-%d-%H.%M.%S).sql.gz
now=$(date +"%d_%m_%Y")
zip -r /home/dspace/Dropbox/$now-assetstore.zip /dspace/assetstore
zip -r /home/dspace/Dropbox/$now-log.zip /dspace/log
Change the Username and Password as your DSpace database and give the right path to the Dropbox directory.
Give the permission for execution
sudo chmod +x Dropbox/backup.sh
Execute the file, Run the following command
sh Dropbox/backup.sh
Now open the Crontab for automatic backup
crontab -e
Select nano editor to open it
Add the following lines at the bottom of the file
30 17 * * * Dropbox/backup.sh
00 17 * * * find Dropbox/* -mtime +60 -exec rm {} ;
Now Save (ctrl+o) and close (ctrl+x)
The above-mentioned commands will take a backup of the database, assetstore, and log files at 5:30 P.M. daily and after 60 days it will delete automatically old files at 05:00 P.M.
How to take a backup of the koha database automatically on Dropbox
1 Comments
Hello sir! do you have a guide of restoring the backup data of dspace7.x?
ReplyDelete