Schedule backup of Asset store and Log folders
Cron job is very helptul to automate the routine tasks in Linux. Using Cron job Dspace user can take regular backup and deposit in an assigned folder. No need to find time for manual backup.
Open Applications > Accessories > Terminal
sudo su
crontab -e
It will ask to select an editor to open crontab, select nano editor.
Copy paste following two lines at the end of crontab,
45 16 * * * zip -r /home/dspace/backup/assetstore.zip /dspace/assetstore
45 16 * * * zip -r /home/dspace/backup/log.zip /dspace/log
Cron job is very helptul to automate the routine tasks in Linux. Using Cron job Dspace user can take regular backup and deposit in an assigned folder. No need to find time for manual backup.
Open Applications > Accessories > Terminal
sudo su
crontab -e
It will ask to select an editor to open crontab, select nano editor.
Copy paste following two lines at the end of crontab,
45 16 * * * zip -r /home/dspace/backup/assetstore.zip /dspace/assetstore
45 16 * * * zip -r /home/dspace/backup/log.zip /dspace/log
Above command will take backup of assetstore and log folders at evening 4:45 pm. You can change the timing.
Need to change the destination folder of backup (e.g. /home/dspace/backup).
Apply Ctrl + o button to save the file.
Then apply Ctrl + x to leave the cron.
The above mentioned lines have created to take backup evening 4:45 PM and deposit backup in a particular folder in compressed format. You have to change the destination (/home/dspace/backup/assetstore.zip) of your backup folder located. You can add other folders of Dspace in the same manner by creating new lines in cron job
Open Applications > Accessories > Terminal
Apply following commands one by one,
sudo su
pg_dump -U dspace -h localhost -Fc dspace | gzip > dspace-$(date +%Y-%m-%d-%H.%M.%S).gz
Enter the password of Linux user dspace.
References
https://help.ubuntu.com/community/CronHowto#Crontab_Example
Need to change the destination folder of backup (e.g. /home/dspace/backup).
Apply Ctrl + o button to save the file.
Then apply Ctrl + x to leave the cron.
The above mentioned lines have created to take backup evening 4:45 PM and deposit backup in a particular folder in compressed format. You have to change the destination (/home/dspace/backup/assetstore.zip) of your backup folder located. You can add other folders of Dspace in the same manner by creating new lines in cron job
Manual backup of Postgres Database
Open Applications > Accessories > Terminal
Apply following commands one by one,
sudo su
pg_dump -U dspace -h localhost -Fc dspace | gzip > dspace-$(date +%Y-%m-%d-%H.%M.%S).gz
Enter the password of Linux user dspace.
References
https://help.ubuntu.com/community/CronHowto#Crontab_Example
Nice !
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteSir please tell how I can configure the Full text search in Dspace?
ReplyDeletePlease check following link,
Deletehttps://wiki.duraspace.org/display/DSPACE/Configure+full+text+indexing
how the full text searching is possible in Dspace????
ReplyDeletehttp://dspacegeek.blogspot.in/2016/10/full-text-indexing-with-dspace.html
DeleteHai Vimal Sir, Is there any way to execute the DB Backup Query in crontab
ReplyDeletePlease check
Deletehttp://www.defitek.com/blog/2010/01/06/a-simple-yet-effective-postgresql-backup-script/