From 9669ff7f06584914ce620127dce5d3cb01352d46 Mon Sep 17 00:00:00 2001 From: Sergio Date: Wed, 20 Aug 2025 10:51:48 +0200 Subject: [PATCH] corregit backup_maverick.sh --- bash/backup_maverick.sh | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bash/backup_maverick.sh b/bash/backup_maverick.sh index 82df67d..022ebda 100755 --- a/bash/backup_maverick.sh +++ b/bash/backup_maverick.sh @@ -63,7 +63,12 @@ done ## Backup de docker compose y volumenes printf "\n\n>> DETENIENDO CONTENEDORES\n" -docker stop $(docker ps -q) | tee -a "${LOG}" +RUNNING_CONTAINERS=$(docker ps -q) +if [ -n "$RUNNING_CONTAINERS" ]; then + echo "$RUNNING_CONTAINERS" | xargs docker stop | tee -a "${LOG}" +else + printf "No hay contenedores en ejecución\n" | tee -a "${LOG}" +fi FOLDER=DOCKER if [ -d "${BACKUP_DOCKER}" ]; then @@ -79,4 +84,8 @@ if [ -d "${BACKUP_DOCKER_VOLUMES}" ]; then fi printf "\n\n>> ARRANCANDO CONTENEDORES\n" -docker start $(docker ps -a -q) | tee -a "${LOG}" +if [ -n "$RUNNING_CONTAINERS" ]; then + echo "$RUNNING_CONTAINERS" | xargs docker start | tee -a "${LOG}" +else + printf "No hay contenedores para arrancar\n" | tee -a "${LOG}" +fi