From 5af5a064a92ba7bfde93412ec1e5d3350fc49d0d Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 25 Oct 2018 09:42:22 -0600 Subject: [PATCH] replaced redis err check w/ verification of success string piped to log --- root/scripts/backup.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index 57737a4..ea787c3 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -580,14 +580,14 @@ checkExist fs "$sqlDumpDir/$sqlDumpFile" ### 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 -T redis-mailcow echo "$?") -# Verify save was successful -if [ "$checkResult" = 0 ]; then +## redis outputs a simple 'OK' if the export succeeded, so check the log file +## for a line just written that says that specifically +if [ $(tail -1 "$logFile") = "OK" ]; echo -e "${ok}${stamp} -- [SUCCESS] redis state saved --${normal}" \ >> "$logFile" -else - exitError+=("${stamp}_202") -fi + else + exitError+=("${stamp}_202") + fi ### Call borgbackup to copy actual files