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