From cabe1d489408a7ed1f0e370f4c981b96401834b9 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 25 May 2019 13:08:55 -0600 Subject: [PATCH] move SQL cleanup flag immediately after temp dir --- backup_new.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/backup_new.sh b/backup_new.sh index 91e80ef..85b43a4 100755 --- a/backup_new.sh +++ b/backup_new.sh @@ -350,6 +350,8 @@ printf "${cyan}[%s] -- [INFO] Dumping SQL databases --${norm}\n" \ if ! sqlDumpDir=$( mktemp -d 2>>"$logFile"); then exitError 111 "Could not create temporary directory to dump SQL files" fi +# set cleanup flag +sqlCopied=1 printf "${cyan}[%s] -- [INFO] SQL dump files will be temporarily stored in:" \ "$(stamp)" >> "$logFile" printf "\n${yellow}%s/${cyan} --${norm}\n" "$sqlDumpDir" >> "$logFile" @@ -375,8 +377,7 @@ if ! mysqldump -h"${sqlServer}" -u"${sqlUser}" -p"${sqlPass}" \ fi printf "${ok}[%s] -- [SUCCESS] SQL databases dumped successfully --${norm}\n" \ "$(stamp)" >> "$logFile" -# set cleanup flag -sqlCopied=1 +