From dfaeaac441f226a652c2f2626179b0a0bcbfb0da Mon Sep 17 00:00:00 2001 From: Jochen Welzel Date: Wed, 6 Jan 2021 10:50:06 +0100 Subject: [PATCH] add second vm snapshot try without quiesce --- libvirt-zsh-backup.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libvirt-zsh-backup.sh b/libvirt-zsh-backup.sh index 9dcbd36..f87b8c9 100644 --- a/libvirt-zsh-backup.sh +++ b/libvirt-zsh-backup.sh @@ -43,11 +43,17 @@ done # create snapshot dataset zfs create tank/snapshots/$VM -virsh snapshot-create-as --domain $VM --name $SNAPNAME --quiesce --atomic --disk-only $DISKSPEC > /dev/null +virsh snapshot-create-as --domain $VM --name $SNAPNAME --quiesce --atomic --disk-only $DISKSPEC >/dev/null 2>&1 if [ $? -ne 0 ] then - echo "VM snapshot creation failed" >&2 - exit 1 + virsh snapshot-create-as --domain $VM --name $SNAPNAME --disk-only $DISKSPEC >/dev/null 2>&1 + if [ $? -ne 0 ] + then + echo "VM snapshot creation failed" >&2 + exit 1 + else + echo "Snapshot created without --quiesce" + fi fi zfs snapshot "$SRCZFS"@"$SNAPNAME"