Fixed error checking for sqldump and redis dump. Used -T param in exec
This commit is contained in:
parent
7eebd44ce4
commit
3c5d766d0c
@ -556,7 +556,7 @@ 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
|
||||
echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \
|
||||
@ -569,7 +569,7 @@ 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
|
||||
echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \
|
||||
|
Loading…
Reference in New Issue
Block a user