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"