aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <d@falconindy.com>2010-01-20 18:59:56 -0500
committerDave Reisner <d@falconindy.com>2010-01-20 18:59:56 -0500
commit0c0653410f04f89a9d42ebcf50632cc903cf4ee2 (patch)
tree687e5260d7f0c5725a6c73f4c1f6a3781535edf6
parent12b32c1238aff15751b928ad568ef6805ecf2044 (diff)
downloadsquashfu-0c0653410f04f89a9d42ebcf50632cc903cf4ee2.tar.gz
Check for value in array, rather than blindly removing the backup when rsync returns non-zero
-rwxr-xr-xsquashfu12
1 files changed, 8 insertions, 4 deletions
diff --git a/squashfu b/squashfu
index cedd6ae..e4d1f82 100755
--- a/squashfu
+++ b/squashfu
@@ -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