I like this script, but I had to modify my copy because I have used Virt-Manager to switch my VM to using the VirtIO-SCSI driver instead, this allows for the
discard="unmap"
option to be set on the storage, making it self-shrinking... This makes the files sparse, but makes the VM backup take way longer than needed with this script... I used the information found here: https://serverfault.com/questions/665335/what-is-fastest-way-to-copy-a-sparse-file-what-method-results-in-the-smallest-f to modify my copy of the script to run significantly faster...
Perhaps this script could be modified to either detect the "unmap" option, or allow for a customizable switch setting to change the sparse file copy procedure..?
Also an option to use some minimal inline compression on the backup? gZip or PigZip?