From eebaef1dcdc0e884386f360baba2348536bb0a29 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sun, 16 Sep 2012 13:46:10 -0400 Subject: [PATCH] updated backup script for serene. --- scripts/database/serene_backer_upper.sh | 57 ++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/scripts/database/serene_backer_upper.sh b/scripts/database/serene_backer_upper.sh index d2018061..58b49fd7 100644 --- a/scripts/database/serene_backer_upper.sh +++ b/scripts/database/serene_backer_upper.sh @@ -3,7 +3,15 @@ function check_if_failed() { if [ $? -ne 0 ]; then - echo Step failed: $* + echo "Step failed: $*" + return 1 + fi +} + +function exit_if_failed() +{ + check_if_failed + if [ $? -ne 0 ]; then exit 1 fi } @@ -13,20 +21,55 @@ umount /z/backup &>/dev/null # now saddle up the backup. mount /z/backup/ -check_if_failed "mounting backup folder" +exit_if_failed "mounting backup folder" # we should always be synching to an existing set in there. make sure they exist. # for the first ever backup, this is not a good check... -test -d /z/backup/etc -a -d /z/backup/home -check_if_failed "testing presence of prior backup" +#test -d /z/backup/etc -a -d /z/backup/home +#exit_if_failed "testing presence of prior backup" + +############## synch_files /etc /z/backup/etc/ check_if_failed "synching etc to backup" -synch_files /home /z/backup/home/ -check_if_failed "synching home to backup" +############## + +synch_files /home/albums /z/backup/home/albums +check_if_failed "synching home/albums to backup" + +synch_files /home/deepcore /z/backup/home/deepcore +check_if_failed "synching home/deepcore to backup" + +synch_files /home/drupal /z/backup/home/drupal +check_if_failed "synching home/drupal to backup" + +synch_files /home/fred /z/backup/home/fred +check_if_failed "synching home/fred to backup" + +synch_files /home/git /z/backup/home/git +check_if_failed "synching home/git to backup" + +synch_files /home/sharedspam /z/backup/home/sharedspam +check_if_failed "synching home/sharedspam to backup" + +synch_files /home/sim /z/backup/home/sim +check_if_failed "synching home/sim to backup" + +synch_files /home/svn /z/backup/home/svn +check_if_failed "synching home/svn to backup" + +synch_files /home/trac /z/backup/home/trac +check_if_failed "synching home/trac to backup" + +############## + +synch_files /var/lib/mailman /z/backup/var/lib/mailman +check_if_failed "synching var/lib/mailman to backup" + +############## umount /z/backup/ -check_if_failed "unmounting backup folder" +exit_if_failed "unmounting backup folder" -- 2.34.1