From 00e31c25a57629e44815397c00fef18fdf08f6c8 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 20 Oct 2018 05:50:19 -0600 Subject: [PATCH] Changed cleanup to restart and confirm mailflow containers only --- root/scripts/backup.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index 3635278..7554c25 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -178,8 +178,23 @@ function cleanup { "nothing to cleanup" >> "$logFile" fi - ## ensure all docker containers are running - docker-compose up -d + ## restart mailflow docker containers + # start and verify postfix + operateDocker start postfix + if [ "$dockerResult" = "true" ]; then + echo -e "${info}${stamp} -- [INFO] Postfix container is running --" \ + "${normal}" >> "$logFile" + else + exitError+=('103') + fi + # start and verify dovecot + operateDocker start dovecot + if [ "$dockerResult" = "true" ]; then + echo -e "${info}${stamp} -- [INFO] Dovecot container is running --" \ + "${normal}" >> "$logFile" + else + exitError+=('104') + fi } ### operate docker containers @@ -268,6 +283,8 @@ xtraFiles=() ### Error codes errorExplain[101]="Could not stop Postfix container. Please check docker logs" errorExplain[102]="Could not stop Dovecot container. Please check docker logs" +errorExplain[103]="Could not start Postfix container. Please check docker logs" +errorExplain[104]="Could not start Dovecot container. Please check docker logs" errorExplain[201]="There was a problem dumping the SQL database. It has NOT been backed up" errorExplain[202]="There was a problem saving redis state information. It has NOT been backed up" errorExplain[210]="Invalid or non-existant borg base directory specified (borg backup details file)"