Quote:
Originally Posted by Waffles I'm thinking it is looking for the full backup filename with the wrong BACKUPWEEK in it.
I suppose we could just have the full backup run on Monday at 12:00am, but because of the network file transfer we do, I would rather have that done friday night.
any thoughts? |
You are correct. It is the fact that the week changes on Monday, and the script looks for a full backup for the current week on which to base the differential backup.
EDIT: Revised recommendation below ...
Took a look at the script and you could add something like the following into it.
Running with -f option would create or update the file with the "current" week for whatever date you run the script. All backups - whether that full or subsequent diff backups - would use the contents of that file as the BACKUPWEEK patameter. Note: be sure to use a file/folder that cron can write to. I tested this outside of cron - didn't test it within cron.
Code:
BACKUPDATE=`date +%Y%m%d` # date format used in archive names
# BACKUPWEEK=`date +%W` # Week prefix used for backup weekly rotation and naming
# VJS - Commented out above, and added below to allow Weekly baseline to be any day of week.
# Needs full set of tests to be run, including archiving old weeks data, etc.
BACKUPWEEKFILE="/opt/zimbra/backup.week"
case $1 in
-f | --full)
date +%W > $BACKUPWEEKFILE
;;
-d | --diff)
if [ ! -e "$BACKUPWEEKFILE" ]
then
echo Backup Week identifier file "$BACKUPWEEKFILE" not found !
echo You must run a FULL backup before a DIFF backup
exit 1
fi
;;
*)
;;
esac
BACKUPWEEK=`cat $BACKUPWEEKFILE` # Week prefix used for backup weekly rotation and naming