Submitted by Locutus on Sat, 06/18/2011 - 03:43
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
Submitted by JamieCameron on Sat, 06/18/2011 - 17:22 Comment #1
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.
Submitted by Locutus on Sun, 06/19/2011 - 07:29 Comment #2
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?
Submitted by JamieCameron on Sun, 06/19/2011 - 12:06 Comment #3
The post backup command only gets run if the backup succeeds..
Submitted by Locutus on Sun, 06/19/2011 - 16:16 Comment #4
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? :)
Submitted by JamieCameron on Sun, 06/19/2011 - 21:00 Comment #5
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..
Submitted by Locutus on Mon, 06/20/2011 - 02:42 Comment #6
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.
Submitted by JamieCameron on Mon, 06/20/2011 - 13:22 Comment #7
You can configure that on the Module Config page .. but only globally, not on a per-backup basis.