Update backup_named_volumes.sh

This commit is contained in:
2025-07-18 14:12:52 +00:00
parent 3a1a1de536
commit a165b304ed

View File

@@ -24,13 +24,13 @@ ORIGINAL_UID=$(id -u "$ORIGINAL_USER")
ORIGINAL_GID=$(id -g "$ORIGINAL_USER") ORIGINAL_GID=$(id -g "$ORIGINAL_USER")
# Get services # Get services
SERVICE_NAMES=$(yq e '.services | keys | .[]' "$COMPOSE_FILE") SERVICE_NAMES=$(sudo yq e '.services | keys | .[]' "$COMPOSE_FILE")
for SERVICE in $SERVICE_NAMES; do for SERVICE in $SERVICE_NAMES; do
echo "🔍 Found service (${SERVICE})" echo "🔍 Found service (${SERVICE})"
# Get service volumes # Get service volumes
VOLUMES=$(yq e ".services.${SERVICE}.volumes[]" "$COMPOSE_FILE" 2>/dev/null || true) VOLUMES=$(sudo yq e ".services.${SERVICE}.volumes[]" "$COMPOSE_FILE" 2>/dev/null || true)
while IFS= read -r VOLUME; do while IFS= read -r VOLUME; do
# Clean up quotes/whitespace # Clean up quotes/whitespace