X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Farchival%2Fserene_backer_upper.sh;fp=scripts%2Farchival%2Fserene_backer_upper.sh;h=8a8526016877c3b61a12b1078787cad653330306;hb=7b39f7e279005c8466ef508220a532ce2aa4abf8;hp=b6dec6d9eab170f3835f303223fabbcbac17cfd3;hpb=3fbd372b35b15a19fb171d5ae34294ff7b1e6485;p=feisty_meow.git diff --git a/scripts/archival/serene_backer_upper.sh b/scripts/archival/serene_backer_upper.sh index b6dec6d9..8a852601 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" + test_or_continue "synching $source to $dest" } ############## @@ -55,12 +27,12 @@ function synch_to_backup() # now saddle up the backup. #NO LONGER USING MOUNT: mount /z/backup/ -#NO LONGER USING MOUNT: exit_if_failed "mounting backup folder" +#NO LONGER USING MOUNT: test_or_die "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" +#test_or_die "testing presence of prior backup" ############## @@ -80,6 +52,6 @@ synch_to_backup /var/lib/mysql /z/backup/var/lib/mysql ############## #NO LONGER USING MOUNT: umount /z/backup/ -#NO LONGER USING MOUNT: exit_if_failed "unmounting backup folder" +#NO LONGER USING MOUNT: test_or_die "unmounting backup folder"