refactor: Added Monitoring for backup permissions

This commit is contained in:
Torben Brenner 2023-01-27 11:31:36 +01:00
parent 17d48a3636
commit a37bf79c03
1 changed files with 2 additions and 0 deletions

View File

@ -109,7 +109,9 @@ if [ -z "${BACKUP_DIRECTORY}" ]; then
hc_send log "$message" hc_send log "$message"
log INFO "$message" log INFO "$message"
mkdir -p "$BACKUP_DIRECTORY" mkdir -p "$BACKUP_DIRECTORY"
chown -R "$BACKUP_DIRECTORY" bridgehead;
fi 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" "\ ")" BACKUP_SERVICES="$(docker ps --filter ancestor=postgres:14-alpine --format "{{.Names}}" | tr "\n" "\ ")"
log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES"; log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES";
for service in $BACKUP_SERVICES; do for service in $BACKUP_SERVICES; do