diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2012-12-29 16:55:57 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2012-12-29 16:55:57 +0100 |
commit | 3d07f9650206b655516631e770bef479739d2eec (patch) | |
tree | 76b0b0aeabdcbc305db00296dd6f4466c761476b | |
parent | 00261037af7161405f06f43abfe5137c3f2a5db2 (diff) | |
download | rdumpfs-3d07f9650206b655516631e770bef479739d2eec.tar.gz rdumpfs-3d07f9650206b655516631e770bef479739d2eec.tar.xz rdumpfs-3d07f9650206b655516631e770bef479739d2eec.zip |
don't delete rsync log locally if rsync failed
-rwxr-xr-x | rdumpfs | 3 |
1 files changed, 1 insertions, 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 |