Update backup_named_volumes.sh
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user