Filesystem Backup: option to "rescue" previous backup

When scheduling a TAR backup, I'd like an option to rename a potentially existing backup to like "backup-previous.tgz", then creating the new one, and optionally removing the "previous" if and only if the new backup was successful.

Right now, an existing backup file is simply overwritten, and if something fails during backup, you end up with no backup at all.

Status: 
Closed (fixed)

Comments

This sounds like a good case for the pre and post-backup commands. You could have the pre-backup command do the rename or copy to previous.tar.gz , and the post-backup command delete the previous.tar.gz file.

Yes, I pondered using those too... But I was not sure if the post-backup command gets executed always, or only if the backup was successful. :)

I would not want to delete the copy if the backup failed. Can you clarify this?

The post backup command only gets run if the backup succeeds..

Okidoki, thanks, then you can consider this request "fulfilled and closed"! :-)

Oh, one last question about this: What meaning does the "Halt if command fails" option have for the post-backup command? As in, what is there to halt if the command was the last thing to do anyway? :)

That checkbox is bit misleading, so I will fix it in the next release. It really controls if the whole backup is reported as having failed via email if the post-backup command fails..

Aah okay, that makes sense!

Speaking of "reporting backup as failed": Can we maybe have in the Webmin filesystem backup, like in Virtualmin backup, an option "Send report via email only if the backup failed"? :) I think that'd be very useful.

You can configure that on the Module Config page .. but only globally, not on a per-backup basis.