From 2df48f6b7762c3fccb4afd68d817d373c8373dc4 Mon Sep 17 00:00:00 2001 From: James Coleman Date: Fri, 19 Apr 2024 08:49:37 -0500 Subject: [PATCH] Follow backup naming of images in RBD --- kvm-backup-rbd.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kvm-backup-rbd.sh b/kvm-backup-rbd.sh index 8275e53..d9fdceb 100755 --- a/kvm-backup-rbd.sh +++ b/kvm-backup-rbd.sh @@ -151,9 +151,9 @@ while read -r _ DOMAIN _; do for ((i = 0; i < ${#DEVS[@]}; i++)); do DEV=${DEVS[$i]} IMAGE=${IMAGES[$i]} - RBD_POOL=${IMAGE%/*} - RBD_IMAGE=${IMAGE##*/} - BACKUP_NAME="${RBD_POOL}_${RBD_IMAGE}" + # RBD_POOL=${IMAGE%/*} + # RBD_IMAGE=${IMAGE##*/} + # BACKUP_NAME="${RBD_POOL}_${RBD_IMAGE}" # Create a snapshot. rbd snap create "$IMAGE@$SNAPSHOT_NAME" @@ -164,7 +164,7 @@ while read -r _ DOMAIN _; do --verbose \ --stats \ --show-rc \ - "::$BACKUP_NAME-{now}" -; then + "::$DOMAIN-$DEV-{now}" -; then fail "Failed to backup $IMAGE" fi @@ -173,7 +173,7 @@ while read -r _ DOMAIN _; do echo "Pruning backups for $IMAGE" if ! eval borg prune --list \ --show-rc \ - --glob-archives "'$BACKUP_NAME-*'" \ + --glob-archives "'$DOMAIN-$DEV-*'" \ "$PRUNE_OPTIONS"; then fail "Failed to prune $DOMAIN" fi