diff --git a/cleanup.sh b/cleanup.sh index 3565f5d..6e580d3 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -5,7 +5,12 @@ BACKUP_HASH="$1" # Define main directory containing subdirectories to potentially be deleted MAIN_DIRECTORY="/Backups/$BACKUP_HASH/backup-docker-to-local" -echo "Checking backup directory: $MAIN_DIRECTORY" +if [ -d "$MAIN_DIRECTORY" ]; then + echo "Cleaning up directory: $MAIN_DIRECTORY" +else + echo "Error: $MAIN_DIRECTORY does not exist." + exit 1 +fi # Define trigger directory argument as TRIGGER_DIR TRIGGER_DIR="$2"