HeatherComputer / AdvancedBackups

BSD 3-Clause "New" or "Revised" License
30 stars 5 forks source link

Feature request : remove old backups by date or count #48

Closed sbenedict closed 9 months ago

sbenedict commented 10 months ago

Limiting the backups by total size is not always ideal due to variance in world size. Currently a small 200 MB world could preserve backups 25x that size wasting disk space.

Automatically remove backups after a configured number of days and/or backups.

Other suggestions:

HeatherComputer commented 10 months ago

So, I've been thinking about this one.

I'm thinking that I add both of your suggested config values, and then set all three to have a minimum value of 0 - which would then disable the purging for that option altogether.

As an example:

config.advancedbackups.purge.size=50
config.advancedbackups.purge.amount=100
config.advancedbackups.purge.days=0

This would delete the oldest backup when the total space used reaches 50gb, or when there are more than 100 total backups. Alternatively,

config.advancedbackups.purge.size=0
config.advancedbackups.purge.amount=0
config.advancedbackups.purge.days=30

This would keep 30 days of backups, and ignore the other two options.

I wanted to grab your opinion before implementing these, given you were the one who made the suggestion - what do you think @sbenedict?

sbenedict commented 10 months ago

Sounds like a good solution, exactly as I envisioned!

HeatherComputer commented 9 months ago

@sbenedict I've got an early run out here if you want to test it out - I've got some more testing to do on my end but it should be all fully working.

HeatherComputer commented 9 months ago

Okay, now it's all working, and has been tested on several versions. Will push this to CF and Modrinth.