diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-09 00:37:18 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-09 00:37:18 -0500 |
commit | 6efe62e9f650e7c66276831588bac2155382137f (patch) | |
tree | e7b08af446accc80a8dc127462e1163bbfcb4a04 | |
parent | 2ccece4a0426ec3f74e960bdf0da9afe7a4d466b (diff) | |
download | squashfu-6efe62e9f650e7c66276831588bac2155382137f.tar.gz |
Don't bail on a bad rsync, or else we won't clean up mounts. Add --resquash and --resquash-discard-old options to backup dispatcher
-rwxr-xr-x | squashfu | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -73,6 +73,8 @@ do_backup () { ################################ # - Is this resquash day? If so, we need a new squash # - If new squash creation fails, we're in trouble. (by default, keep previous week) + # - Call unmount_all when we're done + # - Print a report if it were requested [[ $(date +%u) -eq $RESQUASH_DAY ]] && { create_new_seed # Set aside last week's tree if user opted to, else delete it all @@ -83,6 +85,10 @@ do_backup () { rm $SEED fi } + + unmount_all + + [[ $REPORT ]] && query_usage full } mount_seed () { @@ -162,7 +168,7 @@ run_rsync() { debug " Options: ${RSYNC_OPTS[@]}" debug " Includes: ${INCLUDES[@]}" debug " Excludes: ${EXCLUDES[@]}" - rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} ${BKUP_ROOT}/rw || return 1 + rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} ${BKUP_ROOT}/rw } unmount_all () { @@ -240,7 +246,7 @@ OPTIONS sufficient space for this operation, or bad things will happen. You can use the -Q operation to estimate how much free space you will need. - --resquash-destroy-old + --resquash-discard-old Similar to --resquash except the old seed and incrementals are discarded after the new seed is created. @@ -254,11 +260,12 @@ HELP dispatch_backup () { while [[ $# -gt 0 ]]; do case $1 in - "-c"|"--config") ;; - "--check-size") ;; - "--resquash") RESQUASH_AFTER=true ;; - "--modifier") shift;MODIFIER=$1 ;; - *) die "Invalid option $1"; usage ;; + "-c"|"--config") ;; + "--report") REPORT=true ;; + "--resquash") RESQUASH_AFTER=true;KEEP_LAST_WEEK=true ;; + "--resquash-discard-old") RESQUASH_AFTER=true;KEEP_LAST_WEEK=false ;; + "--modifier") shift;MODIFIER=$1 ;; + *) die "Invalid option $1"; usage ;; esac shift done |