X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Fserene_backer_upper.sh;h=2092f2f8852719c1afd09fe8b6a2b43ad1b30db1;hb=67e47cc3709a98260bd59fa776cc894baf348fb0;hp=9ac48ac508fe341ab0769475d7109ad154d3e14d;hpb=df435417f4a36cb841389e78bc4ea3784f7d76d3;p=feisty_meow.git diff --git a/scripts/archival/serene_backer_upper.sh b/scripts/archival/serene_backer_upper.sh index 9ac48ac5..2092f2f8 100644 --- a/scripts/archival/serene_backer_upper.sh +++ b/scripts/archival/serene_backer_upper.sh @@ -4,26 +4,6 @@ # # Author: Chris Koeritz -# tests whether the last action worked or not, and if not, it issues the -# complaint passed as the arguments. -function check_if_failed() -{ - if [ $? -ne 0 ]; then - echo "Step FAILed: $*" - return 1 - fi -} - -# uses the failure checking function, but actually exits out of the script -# if there was a failure detected. -function exit_if_failed() -{ - check_if_failed - if [ $? -ne 0 ]; then - exit 1 - fi -} - # given a source and target folder, this synchronizes the source into the target. function synch_to_backup() { @@ -34,16 +14,8 @@ function synch_to_backup() exit 1 fi echo "Synchronizing $source into $dest." -####hmmm: temporary measure until top-level dir bug fixed in synch_files app. -### if [ ! -d "$dest" ]; then -### mkdir -p "$dest" -### if [ $? -ne 0 ]; then -### echo "FAILed to make target directory: $dest" -### return 1 -### fi -### fi synch_files "$source" "$dest" - check_if_failed "synching $source to $dest" + continue_on_error "synching $source to $dest" } ############## @@ -51,16 +23,16 @@ function synch_to_backup() # main body of script... # just undo it first, to try to be sure we know we are mounted properly later. -umount /z/backup &>/dev/null +#NO LONGER USING MOUNT: umount /z/backup &>/dev/null # now saddle up the backup. -mount /z/backup/ -exit_if_failed "mounting backup folder" +#NO LONGER USING MOUNT: mount /z/backup/ +#NO LONGER USING MOUNT: exit_on_error "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 -#exit_if_failed "testing presence of prior backup" +#exit_on_error "testing presence of prior backup" ############## @@ -68,17 +40,18 @@ synch_to_backup /etc /z/backup/etc/ ############## -for subdir in albums deepcore drupal fred git sharedspam sim svn trac ; do +for subdir in fred/Maildir git sharedspam svn trac www-data ; do synch_to_backup /home/$subdir /z/backup/home/$subdir done ############## synch_to_backup /var/lib/mailman /z/backup/var/lib/mailman +synch_to_backup /var/lib/mysql /z/backup/var/lib/mysql ############## -umount /z/backup/ -exit_if_failed "unmounting backup folder" +#NO LONGER USING MOUNT: umount /z/backup/ +#NO LONGER USING MOUNT: exit_on_error "unmounting backup folder"