From: Stelian Pop Date: Mon, 5 May 2008 09:25:27 +0000 (+0000) Subject: Improvements to cron_dump_to_disk X-Git-Tag: release_0_4b42~13 X-Git-Url: https://git.wh0rd.org/?p=dump.git;a=commitdiff_plain;h=b35abb32560f6d36d1c37605e8f1320fd2b4df9f;ds=sidebyside Improvements to cron_dump_to_disk --- diff --git a/CHANGES b/CHANGES index b99fb6b..fcbde06 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,4 @@ -$Id: CHANGES,v 1.291 2008/04/17 15:29:47 stelian Exp $ +$Id: CHANGES,v 1.292 2008/05/05 09:25:27 stelian Exp $ Changes between versions 0.4b41 and 0.4b42 (released xxxxxxxxxxxxxxx) ===================================================================== @@ -37,7 +37,7 @@ Changes between versions 0.4b41 and 0.4b42 (released xxxxxxxxxxxxxxx) Thanks to Kenneth Porter for the bug report. -9. Cleanup the output of the 'cron_dump_to_disk' example. +9. Many improvements to the 'cron_dump_to_disk' example. Thanks to Aaron S. Hawley for the patch. diff --git a/examples/cron_dump_to_disk/backup b/examples/cron_dump_to_disk/backup index d19beef..d1de136 100755 --- a/examples/cron_dump_to_disk/backup +++ b/examples/cron_dump_to_disk/backup @@ -31,10 +31,10 @@ fi # Configuration Parameters # -BACKUPPART="/backup" -BACKUPDIR="current" +BACKUPPART=${BACKUPPART:-"/backup"} +BACKUPDIR=${BACKUPDIR:-"current"} DUMPLOGARCH="$BACKUPPART/backup.dump.log.gz" -FSTODUMP="/ /var /home /mnt/hdb1 /usr" +FSTODUMP=${FSTODUMP:-/ /var /home /mnt/hdb1 /usr} DUMPFILESMODE="0644" DUMPFILESOWN="root.root" @@ -81,17 +81,17 @@ if [ -d $BACKUPPART/$BACKUPDIR -a -w $BACKUPPART/$BACKUPDIR ]; then if [ `expr $SAVAIL - $SREQ` -gt "0" ]; then echo "done." - echo " Available: $SAVAIL MB Required: $SREQ MB." + echo "Available: $SAVAIL MB Required: $SREQ MB." else echo "no enough space!" - echo " There is not enough space left in $BACKUPPART for the backup!" - echo " Available: $SAVAIL MB Required: $SREQ MB." + echo "There is not enough space left in $BACKUPPART for the backup!" + echo "Available: $SAVAIL MB Required: $SREQ MB." echo -n "Remounting backup partition read-only ... " if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then echo "done." else echo "failure!" - echo " There were problems remounting $BACKUPPART in read-only mode!" + echo "There were problems remounting $BACKUPPART in read-only mode!" echo "Aborting ${BACKUP} System Dump Backup." echo "Aborted." echo "-------------------------------------------------------------------------------" @@ -120,14 +120,14 @@ if [ -d $BACKUPPART/$BACKUPDIR -a -w $BACKUPPART/$BACKUPDIR ]; then FSNAME=`echo $FS|tr / _|cut -b 2-` fi sync - echo -n " Starting dump of $FSNAME ( $FS ) ... " + echo -n "Starting dump of $FSNAME ( $FS ) ... " if ( dump -$DLEVEL $UPDATEDDATE -z -M -s 27306 -f $BACKUPPART/$BACKUPDIR/$FSNAME.$BTYPE. $FS &> $BACKUPPART/$BACKUPDIR/$FSNAME.log ) then echo "done." else echo "problems!" - echo " There where problems with the dump of $FSNAME ( $FS )." - echo " Check logfile $BACKUPPART/$BACKUPDIR/$FSNAME.log for more info" - echo " Also check log archive file $DUMPLOGARCH." + echo "There where problems with the dump of $FSNAME ( $FS )." + echo "Check logfile $BACKUPPART/$BACKUPDIR/$FSNAME.log for more info" + echo "Also check log archive file $DUMPLOGARCH." fi cat $BACKUPPART/$BACKUPDIR/$FSNAME.log |gzip >> $DUMPLOGARCH echo "-------------------------------------------------------------------------------" |gzip >> $DUMPLOGARCH @@ -145,14 +145,14 @@ if [ -d $BACKUPPART/$BACKUPDIR -a -w $BACKUPPART/$BACKUPDIR ]; then else echo "problems!" - echo " There are problems with the directory structure." - echo " Check dirs: $BACKUPPART/$BACKUPDIR" + echo "There are problems with the directory structure." + echo "Check dirs: $BACKUPPART/$BACKUPDIR" echo -n "Remounting backup partition read-only ... " if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then echo "done." else echo "failure!" - echo " There were problems remounting $BACKUPPART in read-only mode!" + echo "There were problems remounting $BACKUPPART in read-only mode!" echo "Aborting ${BACKUP} System Dump Backup." echo "Aborted." echo "-------------------------------------------------------------------------------" @@ -169,13 +169,13 @@ if ( mount $BACKUPPART -o remount,ro &> /dev/null ) then echo "done." else echo "failure!" - echo " There were problems remounting $BACKUPPART in read-only mode!" + echo "There were problems remounting $BACKUPPART in read-only mode!" echo "Aborting ${BACKUP} System Dump Backup." echo "Aborted." echo "-------------------------------------------------------------------------------" exit 1 fi -echo "End of ${BACKUP} System Dump Backup." +echo "### End of ${BACKUP} System Dump Backup ###" echo "Done." echo "-------------------------------------------------------------------------------" diff --git a/examples/cron_dump_to_disk/backup_rotate b/examples/cron_dump_to_disk/backup_rotate index 2e8eeb9..c3dc1fa 100755 --- a/examples/cron_dump_to_disk/backup_rotate +++ b/examples/cron_dump_to_disk/backup_rotate @@ -3,7 +3,7 @@ # This script will redirect the backup directory to implement desired backup # schedules. # -# Currently we will use just a seven day format were we just move a link +# We will use just a seven day format where we just move a link # that represents the backup directory, to point to the day of the week. # @@ -17,8 +17,8 @@ else REALDIR=`date +%A` fi -BACKUPPART="/backup" -BACKUPDIR="current" +BACKUPPART=${BACKUPPART:-"/backup"} +BACKUPDIR=${BACKUPDIR:-"current"} echo "### Start of Backup Rotation ###" echo "Using backup partition: $BACKUPPART"