Implemented backup directory validation

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-01 14:48:23 +01:00
parent 87fae0c86c
commit 7b00a6584b

View File

@ -5,7 +5,12 @@ BACKUP_HASH="$1"
# Define main directory containing subdirectories to potentially be deleted # Define main directory containing subdirectories to potentially be deleted
MAIN_DIRECTORY="/Backups/$BACKUP_HASH/backup-docker-to-local" 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 # Define trigger directory argument as TRIGGER_DIR
TRIGGER_DIR="$2" TRIGGER_DIR="$2"