abbbi / virtnbdbackup

Backup utility for Libvirt / qemu / kvm supporting incremental and differential backups + instant recovery (agentless).
http://libvirtbackup.grinser.de/
GNU General Public License v3.0
338 stars 46 forks source link

amount of backup data in human readable size (MB/GB/TB) #173

Closed abbbi closed 6 months ago

abbbi commented 7 months ago

Discussed in https://github.com/abbbi/virtnbdbackup/discussions/172

Originally posted by **slu-010101** April 7, 2024 Hi, it would be nice to make this info more human readable: > [2024-04-07 12:50:09] INFO root disk - backup [vda]: Got 7183 extents to backup. > [2024-04-07 12:50:09] INFO root disk - backup [vda]: 2147483648000 bytes disk size > [2024-04-07 12:50:09] INFO root disk - backup [vda]: 1351024640 bytes of data extents to backup Or some statistic after the successful backup to see something is curious (ransomware,...).
abbbi commented 7 months ago

implemented in branch:

[2024-04-08 21:20:24] INFO root virtnbdbackup - main [main]: Total saved disk data: [5.8MB]

slu-010101 commented 6 months ago

Thank you very much, this project is awesome!

tuomotalvitie commented 6 months ago

I'm not absolutely sure if this is the reason for my error, but these two lines do not seem to enjoy working together: https://github.com/abbbi/virtnbdbackup/blob/af8fb448c7480203e5d4cba25e4463a5fae634ee/libvirtnbdbackup/backup/disk.py#L182 https://github.com/abbbi/virtnbdbackup/blob/af8fb448c7480203e5d4cba25e4463a5fae634ee/libvirtnbdbackup/backup/disk.py#L219

ERROR root virtnbdbackup - main [main]: unsupported operand type(s) for +: 'int' and 'dict'

File "/usr/local/lib/python3.10/dist-packages/virtnbdbackup-2.8-py3.10.egg/libvirtnbdbackup/backup/disk.py", line 219, in backup backupSize = sum(blen for blen in compressedSizes)