Skip to content

Commit

Permalink
Check for value in array, rather than blindly removing the backup whe…
Browse files Browse the repository at this point in the history
…n rsync returns non-zero
  • Loading branch information
falconindy committed Jan 20, 2010
1 parent 12b32c1 commit 0c06534
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions squashfu
Expand Up @@ -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
Expand Down

0 comments on commit 0c06534

Please sign in to comment.