Add domain specific option

This commit is contained in:
GRMrGecko 2022-12-29 16:03:17 -06:00
parent eab8054538
commit 3d381297f2

View File

@ -19,6 +19,9 @@ export BORG_DELETE_I_KNOW_WHAT_I_AM_DOING=NO
# Set to empty string to disable pruning. # Set to empty string to disable pruning.
PRUNE_OPTIONS="--keep-daily 7 --keep-weekly 4 --keep-monthly 6" PRUNE_OPTIONS="--keep-daily 7 --keep-weekly 4 --keep-monthly 6"
# Allows providing an argument of a domain to specifically backup.
BACKUP_DOMAIN="$1"
# I save the status in a temporary file so I can error out and exit if a failure occurs. # I save the status in a temporary file so I can error out and exit if a failure occurs.
DOMLIST_STATUS_TMP="/tmp/backup-image-domlist-tmp" DOMLIST_STATUS_TMP="/tmp/backup-image-domlist-tmp"
while read -r line; do while read -r line; do
@ -31,6 +34,11 @@ while read -r line; do
continue continue
fi fi
# If a backup domain was provided, we're only going to backup that domain.
if [ -n "$BACKUP_DOMAIN" ] && [[ "$BACKUP_DOMAIN" != "$DOMAIN" ]]; then
continue
fi
# Get the images that need backing up. # Get the images that need backing up.
DEVS=() DEVS=()
IMAGES=() IMAGES=()