From 2ada11039ad49c0582898c5120f7fa3a8f199657 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 7 Sep 2018 04:17:09 -0600 Subject: [PATCH] added cleanup before exiting in checkExist --- root/scripts/borgbackup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/root/scripts/borgbackup.sh b/root/scripts/borgbackup.sh index 8047894..2361aa7 100755 --- a/root/scripts/borgbackup.sh +++ b/root/scripts/borgbackup.sh @@ -219,6 +219,8 @@ function checkExist { elif [ "$2" = "error" ]; then echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \ "${3} was not found--\e[0m" >> $logFile + cleanup 503 + cleanup sqlDump quit 101 else # file not found, return proper code @@ -232,6 +234,8 @@ function checkExist { else echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \ "Problem creating ${2}--\e[0m" >> $logFile + cleanUp 503 + cleanUp sqlDump quit 102 fi else