From f8561a3aab81a7bbd0b50c2ca20ab34542a9ceb8 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Thu, 7 May 2020 00:17:41 -0600 Subject: [PATCH] restart docker containers in cleanup function --- .vscode/numbered-bookmarks.json | 4 ++-- backup/backup.sh | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 03063a9..7c01f9e 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -4,6 +4,7 @@ "fsPath": "$ROOTPATH$/backup/backup.sh", "bookmarks": [ -1, + 97, -1, -1, -1, @@ -11,8 +12,7 @@ -1, -1, -1, - -1, - 613 + 628 ] } ] diff --git a/backup/backup.sh b/backup/backup.sh index 403e26c..ea27e55 100644 --- a/backup/backup.sh +++ b/backup/backup.sh @@ -95,6 +95,21 @@ cleanup() { "$cyan" "$(stamp)" "$norm" >> "$logFile" fi fi + # start docker containers (no harm if they are already running) + doDocker start postfix + if [ "$dockerResultState" = "true" ]; then + printf "%s[%s] -- [INFO] POSTFIX container is running --%s\n" \ + "$cyan" "$(stamp)" "$norm" >> "$logFile" + else + exitError 102 'Could not start POSTFIX container.' + fi + doDocker start dovecot + if [ "$dockerResultState" = "true" ]; then + printf "%s[%s] -- [INFO] DOVECOT container is running --%s\n" \ + "$cyan" "$(stamp)" "$norm" >> "$logFile" + else + exitError 102 'Could not start DOVECOT container.' + fi } doDocker() { @@ -751,6 +766,7 @@ exit 0 # 3: borg not installed # 99: TERM signal trapped # 101: could not stop container(s) +# 102: could not start container(s) # 115: unable to create temp dir for SQL dump # 118: error dumping SQL database # 119: error dumping redis database