diff options
author | Dave Reisner <d@falconindy.com> | 2010-01-20 18:59:56 -0500 |
---|---|---|
committer | Dave Reisner <d@falconindy.com> | 2010-01-20 18:59:56 -0500 |
commit | 0c0653410f04f89a9d42ebcf50632cc903cf4ee2 (patch) | |
tree | 687e5260d7f0c5725a6c73f4c1f6a3781535edf6 | |
parent | 12b32c1238aff15751b928ad568ef6805ecf2044 (diff) | |
download | squashfu-0c0653410f04f89a9d42ebcf50632cc903cf4ee2.tar.gz |
Check for value in array, rather than blindly removing the backup when rsync returns non-zero
-rwxr-xr-x | squashfu | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -255,11 +255,15 @@ action_backup () { debug "rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT"" info "Creating new incremental" /usr/bin/rsync ${RSYNC_OPTS[@]} ${INCLUDES[@]} ${EXCLUDES[@]} "$UNION_MOUNT" + rsync_ret=$? - if [[ $? -gt 0 && $DEL_BIN_ON_FAIL == "true" ]]; then - warn "Unexpected hangup by rsync. Deleting backup." - action_remove_bin $new_bin override - fi + # TODO: convert to check for error code in array + for $error in ${DEL_BIN_ON_FAIL[@]}; do + if [[ $rsync_ret == $error ]]; then + warn "Unexpected hangup by rsync ($error). Deleting backup." + action_remove_bin $new_bin override + fi + done check_for_resquash if [[ val=$? -gt 0 ]]; then |