corregit backup_maverick.sh

This commit is contained in:
2025-08-20 10:51:48 +02:00
parent 5ef5a4e9be
commit 9669ff7f06
+11 -2
View File
@@ -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