#!/bin/bash
exec >> /4server/data/log/backupAll.log 2>&1
echo "$(date '+%Y-%m-%d %H:%M') Starting backupAll"

BIN_PATH="/4server/sbin"

containers=$(docker ps --format '{{.Names}}' | grep -E '^[0-9]{3}-[0-9]{3}')

if [[ -z "$containers" ]]; then
    echo "No containers matching pattern NNN-NNN found."
    exit 0
fi

echo "Found containers:"
while IFS= read -r container; do
    echo "  $container"
    touch "/4server/data/$container/cc/backup"
done <<< "$containers"
