From: ssire <ste...@ep...> - 2014-05-30 17:58:43
|
It seems there is also a BackupSystemTask alternative for backup and it supports a zip-files-max parameter : <parameter name="zip-files-max" value="4"/> Unfortunately this parameter is not available for ConsistencyCheckTask as stated in [1]. So to summarize here is my understanding of the differences between the 3 different ways to schedule database backups inside conf.xml : - ConsistencyCheckTask : applies to full /db, including binary files, no built-in rotating backups, safe as it does a consistency check before backup, non blocking for read operations - DataBackup : applies to full /db, excluding binary files, no built-in rotating backups, unsafe because *.dbx files snapshot, the fastest - BackupSystemTask : applies to any collection, built-in rotating backups, safe as it waits for all transactions to terminate, but reported to stop functioning after a few days [2] which I confirm since I have the same problem (at least with eXist 1.4.1 under tomcat) Now to come back to my initial question, rotating backup with ConsistencyCheckTask, I finally wrote a shell script cleanup-backups.sh which I reproduce below and that should keep only MAX_DAYS of backups inside BACKUPS_DIR when run daily using a cron job. It is based on the generated standardized timestamped backup file names produced by the ConsistencyCheckTask. Stephane --- [1] http://markmail.org/message/45nrccmyfqmbdsnb [2] http://exist-open.markmail.org/thread/7eue5kro5w2hgpi2 #! /bin/sh MAX_DAYS=8 BACKUPS_DIR="/path/to/your/backup/dir" DATE_LIMIT=`date -v -"$MAX_DAYS"d "+%Y%m%d-%H%M"` echo "At `date "+%H:%M on %Y-%m-%d"` removing backups anteriors to $DATE_LIMIT" FULL="`ls -1 "$BACKUPS_DIR"/full*`" for F in $FULL; do if [ $(expr ${F#$BACKUPS_DIR/full} \< "$DATE_LIMIT.zip") -eq 1 ] then echo "deleting $F"; rm $F fi done INC="`ls -1 "$BACKUPS_DIR"/inc*`" for F in $INC; do if [ $(expr ${F#$BACKUPS_DIR/inc} \< "$DATE_LIMIT.zip") -eq 1 ] then echo "deleting $F"; rm $F fi done -- View this message in context: http://exist.2174344.n4.nabble.com/Seeking-advice-on-setting-up-rotating-database-backup-files-and-more-tp4664648p4664660.html Sent from the exist-open mailing list archive at Nabble.com. |