Follow backup naming of images in RBD
This commit is contained in:
parent
8362d93969
commit
2df48f6b77
@ -151,9 +151,9 @@ while read -r _ DOMAIN _; do
|
|||||||
for ((i = 0; i < ${#DEVS[@]}; i++)); do
|
for ((i = 0; i < ${#DEVS[@]}; i++)); do
|
||||||
DEV=${DEVS[$i]}
|
DEV=${DEVS[$i]}
|
||||||
IMAGE=${IMAGES[$i]}
|
IMAGE=${IMAGES[$i]}
|
||||||
RBD_POOL=${IMAGE%/*}
|
# RBD_POOL=${IMAGE%/*}
|
||||||
RBD_IMAGE=${IMAGE##*/}
|
# RBD_IMAGE=${IMAGE##*/}
|
||||||
BACKUP_NAME="${RBD_POOL}_${RBD_IMAGE}"
|
# BACKUP_NAME="${RBD_POOL}_${RBD_IMAGE}"
|
||||||
|
|
||||||
# Create a snapshot.
|
# Create a snapshot.
|
||||||
rbd snap create "$IMAGE@$SNAPSHOT_NAME"
|
rbd snap create "$IMAGE@$SNAPSHOT_NAME"
|
||||||
@ -164,7 +164,7 @@ while read -r _ DOMAIN _; do
|
|||||||
--verbose \
|
--verbose \
|
||||||
--stats \
|
--stats \
|
||||||
--show-rc \
|
--show-rc \
|
||||||
"::$BACKUP_NAME-{now}" -; then
|
"::$DOMAIN-$DEV-{now}" -; then
|
||||||
fail "Failed to backup $IMAGE"
|
fail "Failed to backup $IMAGE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ while read -r _ DOMAIN _; do
|
|||||||
echo "Pruning backups for $IMAGE"
|
echo "Pruning backups for $IMAGE"
|
||||||
if ! eval borg prune --list \
|
if ! eval borg prune --list \
|
||||||
--show-rc \
|
--show-rc \
|
||||||
--glob-archives "'$BACKUP_NAME-*'" \
|
--glob-archives "'$DOMAIN-$DEV-*'" \
|
||||||
"$PRUNE_OPTIONS"; then
|
"$PRUNE_OPTIONS"; then
|
||||||
fail "Failed to prune $DOMAIN"
|
fail "Failed to prune $DOMAIN"
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user