From ba2517138e01a47ba0102597f33a4bb292a1de81 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 19 Oct 2018 23:39:20 -0600 Subject: [PATCH] Stop postfix and dovecot in preparation for backup --- root/scripts/backup.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/root/scripts/backup.sh b/root/scripts/backup.sh index 597a2b3..b4446b9 100644 --- a/root/scripts/backup.sh +++ b/root/scripts/backup.sh @@ -451,6 +451,18 @@ fi ### --- End 503 section --- +### Change directory to mailcowPath +cd "$mailcowPath" + +### Stop postfix and dovecot so mailflow is stopped until backup is completed +echo -e "${op}${stamp} Stopping postfix and dovecot containers now..." \ + "${normal}" >> "$logFile" +docker-compose stop --timeout ${dockerStopTimeout} 2>> "$logFile" +# docker-compose always returns an error code of 0, so there is no point error +# checking +echo -e "${op}${stamp} ...done${normal}" >> "$logFile" + + ### Dump SQL echo -e "${op}${stamp} Dumping NextCloud SQL database...${normal}" >> "$logFile" mysqldump --single-transaction -h"${sqlParams[0]}" -u"${sqlParams[1]}" \