refactor: Use -db as Indicator for Backups

This commit is contained in:
Torben Brenner 2023-01-27 11:49:18 +01:00
parent a37bf79c03
commit 98afeac701
1 changed files with 2 additions and 1 deletions

View File

@ -112,7 +112,8 @@ if [ -z "${BACKUP_DIRECTORY}" ]; then
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" "\ ")"
# Collect all container names that contain '-db'
BACKUP_SERVICES="$(docker ps --filter name=-db --format "{{.Names}}" | tr "\n" "\ ")"
log INFO "Performing automatic maintenance: Creating Backups for $BACKUP_SERVICES";
for service in $BACKUP_SERVICES; do
if [ ! -d "$BACKUP_DIRECTORY/$service" ]; then