KVM backups snapshots to file virt-back

Hey I just picked up hacking on a very old project of mine. it uses the libvirt api to safely shutdown KVM instances prior to copying qcow images, the script now checks if the disk is a zfs dataset and will instead snapshot the instance and bring the instance back online asap while later we zfs send to a file (gzip or not)

here’s an example command, historically I used a crontab entry weekly or daily depending on the need.

./virt-back -u "qemu+unix:///system?socket=/run/truenas_libvirt/libvirt-sock" --backup-all --path /mnt/personal/backup/virt-back --no-gzip --retention 5

please let me know what you think and suggestions on how to safely restore a VM from a sent file. thank

1 Like