Updated SQL dump section to use new quit function
This commit is contained in:
parent
664290acd2
commit
af035719f8
@ -293,16 +293,16 @@ mapfile -t sqlParams < $sqlDetails
|
|||||||
|
|
||||||
## Dump SQL
|
## Dump SQL
|
||||||
echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
|
echo -e "\e[1;36m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
|
||||||
"Dumping SQL...\e[0m" >> $logFile
|
"Dumping SQL...\e[0m" >> $logFileVerbose
|
||||||
mysqldump --single-transaction -h${sqlParams[0]} -u${sqlParams[1]} \
|
mysqldump --single-transaction -h${sqlParams[0]} -u${sqlParams[1]} \
|
||||||
-p${sqlParams[2]} ${sqlParams[3]} > "$sqlDumpDir/$sqlDumpFile" 2>> $logFile
|
-p${sqlParams[2]} ${sqlParams[3]} > "$sqlDumpDir/$sqlDumpFile" \
|
||||||
|
2>> $logFileVerbose
|
||||||
|
dumpResult="$?"
|
||||||
# verify
|
# verify
|
||||||
if [ "$?" = "0" ]; then
|
if [ "$dumpResult" = "0" ]; then
|
||||||
echo -e "\e[0;36m...done\e[0m" >> $logFile
|
echo -e "\e[0;36m...done\e[0m" >> $logFileVerbose
|
||||||
else
|
else
|
||||||
echo -e "\e[1;31m--Error-- There was a problem dumping SQL." >> $logFile
|
quit 200
|
||||||
echo -e "\e[4;31mScript aborted\e[0;31m.\e[0m" >> $logFile
|
|
||||||
exit 201
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
## Ready for Borg
|
## Ready for Borg
|
||||||
|
Loading…
Reference in New Issue
Block a user