From 3c5d766d0c4385602d0f9819d25a2f56cad045ee Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 25 Oct 2018 05:17:14 -0600 Subject: [PATCH] Fixed error checking for sqldump and redis dump. Used -T param in exec --- root/scripts/backup.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index a0eece0..04982be 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -556,9 +556,9 @@ fi ### Dump SQL echo -e "${op}${stamp} Dumping mailcow SQL database...${normal}" >> "$logFile" docker-compose exec mysql-mailcow mysqldump --default-character-set=utf8mb4 -u${DBUSER} -p${DBPASS} ${DBNAME} > "$sqlDumpDir/$sqlDumpFile" 2>> "$logFile" -checkResult=$(docker-compose exec mysql-mailcow echo "$?") +checkResult=$(docker-compose exec -T mysql-mailcow echo $?) # verify sql dump was successful -if [ "$checkResult"=0 ]; then +if [ "$checkResult" = 0 ]; then echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \ >> "$logFile" else @@ -569,9 +569,9 @@ fi ### Save redis state echo -e "${op}${stamp} Saving redis state information...${normal}" >> "$logFile" docker-compose exec redis-mailcow redis-cli save >> "$logFile" 2>&1 -checkResult=$(docker-compose exec redis-mailcow echo "$?") +checkResult=$(docker-compose exec -T redis-mailcow echo "$?") # Verify save was successful -if [ "$checkResult"=0 ]; then +if [ "$checkResult" = 0 ]; then echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \ >> "$logFile" else