move SQL cleanup flag immediately after temp dir

This commit is contained in:
Asif Bacchus 2019-05-25 13:08:55 -06:00
parent fa82cb2ce6
commit cabe1d4894

View File

@ -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