restart docker containers in cleanup function

This commit is contained in:
Asif Bacchus 2020-05-07 00:17:41 -06:00
parent 1b68616e54
commit f8561a3aab
2 changed files with 18 additions and 2 deletions

View File

@ -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
]
}
]

View File

@ -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