MommyHeather / AdvancedBackups

BSD 3-Clause "New" or "Revised" License
21 stars 4 forks source link

Make sure auto-cleanup doesn't purge chained backups that are being relied on #5

Open MommyHeather opened 1 year ago

MommyHeather commented 1 year ago

Auto-purge currently deletes the oldest backup. This breaks differential and incremental chains.

Differentials are easy - if the oldest full backup is being relied on, delete the oldest non-full. Incrementals however are a MAJOR problem.

With incrementals, the entire chain is linked - restoring a partial backup means also restoring every other partial backup since the last full backup, whereas differentials only require the last full backup.

As such, we have two options :

We could have a user config for this...?

superhealing commented 1 year ago

I think the best idea is to introduce a user configuration option. This option allows users to choose how auto-cleanup behaves. They can either delete the entire backup chain, including linked incremental backups, or they can ignore the set limit and manage backup storage manually. This user configuration option provides flexibility and ensures that users can preserve their backup chains or take full control over backup management. At cost of expensive documentation.

MisterMyst commented 1 year ago

I think it should take into account the max number of chains and how many chains there currently are. I don't ever see a case where a user would be happy with an entire chain being deleted if it's the ONLY chain, basically nuking all backups.

So, if there's more than one incremental chain, delete the oldest one if necessary If there's only one incremental chain, do nothing, and report it, with a recommendation to reduce max chain length/increase chain amount and/or increase max space

MommyHeather commented 1 year ago

So :

Thoughts on this?

MommyHeather commented 1 year ago

Okay, this is now done - though, we do not have a good way to alert users. @MisterMyst @superhealing I don't suppose you've got comments on how we alert the user? I feel just writing to the log isn't very helpful..

Spennorex commented 1 month ago

Maybe you could write it both to log, and also store the message to be displayed to an opped user at their logon?

Also, not sure if this has been offered yet, but if you have a discord bot/webhook to give backup results inside of a discord channel, you could use that as another channel to relay this information to an admin. (or ofc other connectors, to maybe Matrix, IRC, or similar.)