]> arthur.ath.cx Git - backup-script.git/blobdiff - bin/backup-script
Don't clean up when "setup_exec" command failed
[backup-script.git] / bin / backup-script
index 04572682d78832f7acde423f8b8013f41e7deedd..fdd642719cc68e062e8a55c86fbfcde35c002701 100755 (executable)
@@ -330,8 +330,6 @@ echo "Rsync command is $rsync, protocol version $rsync_proto."
 [[ -n "$TAG" ]] && echo "Running jobs tagged with \"$TAG\"."
 echo
 
-trap GotSignal SIGINT
-
 if [ $# -ge 1 ]; then
        for s in "$@"; do
                if [ ! -r "${conf_d}/$s" ]; then
@@ -349,7 +347,6 @@ if [ -n "$setup_exec" ]; then
        sh -c $setup_exec
        if [ $? -ne 0 ]; then
                echo "Error: setup command failed!"; echo
-               CleanUp
                echo "Aborting backup."; echo
                exit 5
        fi
@@ -357,6 +354,8 @@ if [ -n "$setup_exec" ]; then
        echo
 fi
 
+trap GotSignal SIGINT
+
 # check and create PID file
 if [ -e "$PIDFILE" ]; then
        echo "Lockfile \"$PIDFILE\" already exists."