Make backups error if the backup directory already exists

This commit is contained in:
Matthew Lopez 2024-05-03 08:24:13 -04:00 committed by GitHub
parent e7953be311
commit 4a4643b1d8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,9 +11,10 @@ if [ -z "$backup_name" ]; then
fi
backup_dir="$git_base/backups/$backup_name"
if [ ! -d "$backup_dir" ]; then
mkdir -p "$backup_dir"
if [ -d "$backup_dir" ]; then
error "Backup directory $backup_dir already exists."
fi
mkdir -p "$backup_dir"
info "Backing up to $backup_dir"
docker compose up -d mitmproxy-pretendo mongodb postgres minio redis