From a37bf79c030908e80284c981975161bb31b989cc Mon Sep 17 00:00:00 2001 From: Torben Brenner Date: Fri, 27 Jan 2023 11:31:36 +0100 Subject: [PATCH] refactor: Added Monitoring for backup permissions --- lib/update-bridgehead.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/update-bridgehead.sh b/lib/update-bridgehead.sh index 276f60c..0f1c413 100755 --- a/lib/update-bridgehead.sh +++ b/lib/update-bridgehead.sh @@ -109,7 +109,9 @@ if [ -z "${BACKUP_DIRECTORY}" ]; then hc_send log "$message" log INFO "$message" mkdir -p "$BACKUP_DIRECTORY" + chown -R "$BACKUP_DIRECTORY" bridgehead; fi + checkOwner "$BACKUP_DIRECTORY" bridgehead || fail_and_report 1 "Automatic maintenance failed: Wrong permissions for backup directory $(pwd)" BACKUP_SERVICES="$(docker ps --filter ancestor=postgres:14-alpine --format "{{.Names}}" | tr "\n" "\ ")" log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES"; for service in $BACKUP_SERVICES; do