View Single Post
  #160 (permalink)  
Old 10-03-2009, 09:40 AM
chewitt chewitt is offline
Active Member
 
Posts: 30
Default

I made some minor tweaks to the script. To apply them copy the code below and paste them over the original section around line 750:

Code:
    # over view of all the files which where backed up
    echo "Creating file listing from archive..."
    if [ "$CRYPT" = "yes" ]
	then
	    KEY=`cat "$PASSDIR""$PASSFILE"`
	    nice -19 $DAR_BIN -K bf:$KEY -l "$ARCHIVEDIR""$BACKUPWEEK"_"$BACKUPNAME"_"$BACKUPDATE"_"$PREFIX" -Q\
	    > "$ARCHIVEDIR""$BACKUPWEEK"Backuplist-"$BACKUPDATE".txt && gzip -9 "$ARCHIVEDIR""$BACKUPWEEK"Backuplist-"$BACKUPDATE".txt
	else        
	    nice -19 $DAR_BIN -l "$ARCHIVEDIR""$BACKUPWEEK"_"$BACKUPNAME"_"$BACKUPDATE"_"$PREFIX" -Q\
	    > "$ARCHIVEDIR""$BACKUPWEEK"Backuplist-"$BACKUPDATE".txt && gzip -9 "$ARCHIVEDIR""$BACKUPWEEK"Backuplist-"$BACKUPDATE".txt
	fi
	# Script Timer
    STOPTIME=(`date +%s`)
    RUNTIME=$(expr $STOPTIME - $STARTTIME)
    echo
    echo ":::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" 
    echo "Zimbra $TYPE backup ended at: `date +%H:%M`" 
    echo "Backup took $(date -d "1970-01-01 $RUNTIME sec" +%H:%M:%S) to complete" 
    echo ":::::::::::::::Cheers Osoffice for the script:::::::::::::::::::::::::"
    (cat $LOG; $UUENCODE_BIN "$ARCHIVEDIR""$BACKUPWEEK"_Backuplist-"$BACKUPDATE".txt.gz "$ARCHIVEDIR"Backuplist-"$BACKUPDATE".txt.gz) \
    | mail -c $EMAILCC -s "Zimbra $TYPE Backup Log on $HOSTNAME" $EMAIL
}
a) I've altered the naming of the backuplist file to follow the format used by the data files, e.g. 38_Zimbra_Backup_03-October-2009_LIST.txt instead of Backuplist-03-October-2009.txt. Doing this ensures the files are matched and relocated along with the .dar and .md5 files when a full backup is run, instead of leaving them orphaned to clutter up the current backup directory.

b) The logic for counting total backup runtime in hours:mins:secs in the original script doesn't quite work and backups taking greater than 1 hour miss-report the number of minutes by not deducting 60 for each hour elapsed, e.g. 1:89:42 is reported instead of 1:29:42. After the change the displayed format is slightly different but elapsed time is shown correctly.

c) I added the backup $TYPE in the summary statement.

Christian
Reply With Quote