From 3d07f9650206b655516631e770bef479739d2eec Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sat, 29 Dec 2012 16:55:57 +0100 Subject: don't delete rsync log locally if rsync failed --- rdumpfs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rdumpfs b/rdumpfs index 0407a94..98ccbf5 100755 --- a/rdumpfs +++ b/rdumpfs @@ -43,9 +43,8 @@ if [[ "$last" = "$now" ]]; then fi LOGFILE=$(mktemp -t .rdumpfs.XXXXXXXX.log) -trap "rm -f $LOGFILE" INT QUIT TERM HUP EXIT - rsync --log-file $LOGFILE "${rsync_args[@]}" "${src[@]}" "$dst/$now" EC=$? rsync $LOGFILE "$dst/$now/" +(( $EC )) || rm -f $LOGFILE exit $EC -- cgit 1.4.1