NAUbackup / VmBackup

XenServer simple backup script
228 stars 61 forks source link

Add option to delete old backups first #49

Closed brgsousa closed 7 years ago

brgsousa commented 7 years ago

Hi, when you set max_backups, it deletes the old backup after backing up the current one. Disk usage could be optimized by deleting old backups first and then backing up the current one. Think of VMs that have 500GB of disks.

NAUbackup commented 7 years ago

Hi... Thank you for your feedback. This is very deliberately done afterwards for if the backup should fail and you only have one to start with, you would end up with nothing. If the VM is corrupted and the backup fails, you would have no way at all then to recover it. You could of course manually delete it ahead of time by writing a separate script to be executed before the main backup script is kicked off via cron to take care of such exceptions, is what I'd suggest.

brgsousa commented 7 years ago

Thank you for your answer! Your script is being very helpful at work, thank you!