Merge pull request 'Fix backup script removing image after unsuccessful pivot' (#549) from bugfix/vm_backups into master

Reviewed-on: #549
This commit was merged in pull request #549.
This commit is contained in:
2024-03-11 15:35:50 +00:00

View File

@@ -22,8 +22,5 @@ borg create -v $REPOSITORY::$1_$(date +%F_%H-%M) \
/var/lib/libvirt/images/$1.qcow2 \ /var/lib/libvirt/images/$1.qcow2 \
/root/backups/vm_meta/$1.xml /root/backups/vm_meta/$1.xml
echo "Pivoting base image back to original" echo "Pivoting base image back to original, and removing the snapshot image"
virsh blockcommit $1 vda --pivot --base=/var/lib/libvirt/images/$1.qcow2 virsh blockcommit $1 vda --pivot --base=/var/lib/libvirt/images/$1.qcow2 && rm /var/lib/libvirt/images/$1.hotswap.qcow2
echo "Removing snapshot image"
rm /var/lib/libvirt/images/$1.hotswap.qcow2