Open HeatherComputer opened 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.
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
So :
With differentials, delete the oldest partial backup if the oldest full backup is being relied on. Do not adjust the chain length, so as to allow new full backups to be made again in due time.
With incrementals, delete the entire chain if:
Otherwise, ignore the space limits and find a way to warn the user. (What's a good way?)
Thoughts on this?
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..
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.)
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...?