about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xrdumpfs3
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