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 if ! sqlDumpDir=$( mktemp -d 2>>"$logFile"); then
exitError 111 "Could not create temporary directory to dump SQL files" exitError 111 "Could not create temporary directory to dump SQL files"
fi fi
# set cleanup flag
sqlCopied=1
printf "${cyan}[%s] -- [INFO] SQL dump files will be temporarily stored in:" \ printf "${cyan}[%s] -- [INFO] SQL dump files will be temporarily stored in:" \
"$(stamp)" >> "$logFile" "$(stamp)" >> "$logFile"
printf "\n${yellow}%s/${cyan} --${norm}\n" "$sqlDumpDir" >> "$logFile" printf "\n${yellow}%s/${cyan} --${norm}\n" "$sqlDumpDir" >> "$logFile"
@ -375,8 +377,7 @@ if ! mysqldump -h"${sqlServer}" -u"${sqlUser}" -p"${sqlPass}" \
fi fi
printf "${ok}[%s] -- [SUCCESS] SQL databases dumped successfully --${norm}\n" \ printf "${ok}[%s] -- [SUCCESS] SQL databases dumped successfully --${norm}\n" \
"$(stamp)" >> "$logFile" "$(stamp)" >> "$logFile"
# set cleanup flag
sqlCopied=1