Fixed error checking for sqldump and redis dump. Used -T param in exec
This commit is contained in:
parent
7eebd44ce4
commit
3c5d766d0c
@ -556,9 +556,9 @@ fi
|
|||||||
### Dump SQL
|
### Dump SQL
|
||||||
echo -e "${op}${stamp} Dumping mailcow SQL database...${normal}" >> "$logFile"
|
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"
|
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
|
# verify sql dump was successful
|
||||||
if [ "$checkResult"=0 ]; then
|
if [ "$checkResult" = 0 ]; then
|
||||||
echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \
|
echo -e "${ok}${stamp} -- [SUCCESS] SQL successfully dumped --${normal}" \
|
||||||
>> "$logFile"
|
>> "$logFile"
|
||||||
else
|
else
|
||||||
@ -569,9 +569,9 @@ fi
|
|||||||
### Save redis state
|
### Save redis state
|
||||||
echo -e "${op}${stamp} Saving redis state information...${normal}" >> "$logFile"
|
echo -e "${op}${stamp} Saving redis state information...${normal}" >> "$logFile"
|
||||||
docker-compose exec redis-mailcow redis-cli save >> "$logFile" 2>&1
|
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
|
# Verify save was successful
|
||||||
if [ "$checkResult"=0 ]; then
|
if [ "$checkResult" = 0 ]; then
|
||||||
echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \
|
echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \
|
||||||
>> "$logFile"
|
>> "$logFile"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user