diff --git a/backup.sh b/backup.sh index 355bcbc..ce19dc4 100644 --- a/backup.sh +++ b/backup.sh @@ -5,7 +5,8 @@ if [ "$1" = "local" ]; then elif [ "$1" = "restic" ]; then source /backup_restic.sh elif [ "$1" = "loop" ]; then - # Inifinite loop to keep the container running and let Ofelia scheduler (or any other) manage the execution + # Infinite loop to keep the container running and let Ofelia scheduler (or any other) manage the execution + echo "Entering infinite loop mode. Use external scheduler to trigger backups." while true; do sleep 86400 done diff --git a/backup_local.sh b/backup_local.sh index eaca647..5f07eb4 100644 --- a/backup_local.sh +++ b/backup_local.sh @@ -16,7 +16,8 @@ if [ -z "$TARGET_DIR" ]; then exit 1 fi -if [ ! `docker info` ]; then +docker info > /dev/null 2>&1 +if [ ! $? -eq 0 ]; then echo "Docker is not available." exit 1 fi diff --git a/backup_restic.sh b/backup_restic.sh index daeebee..990db3b 100644 --- a/backup_restic.sh +++ b/backup_restic.sh @@ -22,7 +22,8 @@ if [ -z "$RESTIC_REPOSITORY" ]; then exit 1 fi -if [ ! `docker info` ]; then +docker info > /dev/null 2>&1 +if [ ! $? -eq 0 ]; then echo "Docker is not available." exit 1 fi