-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable weekly, monthly, quarterly and yearly retention schema #9
base: master
Are you sure you want to change the base?
Conversation
andresch
commented
Apr 21, 2015
- new config properties EXPIRY_WEEK, EXPIRY_MONTH, EXPIRY_QUARTER and EXPIRY_YEAR
- longest period wins (when first day of year is also first day of week then EXPIRY_YEAR is selected)
- support infinite retention with value 0
- explicitly use /bin/bash instead of /bin/sh to avoid script errors when bash is not default shell
- new config properties EXPIRY_WEEK, EXPIRY_MONTH, EXPIRY_QUARTER and EXPIRY_YEAR - longest period wins (if first day of year is also first day of week year is selected) - support infinite retention with value 0 - explicitly use /bin/bash instead of /bin/sh to avoid script errors is bash is not default shell
Nice bit of code. I previously decided not to implement complex expiry logic because there isn't a lot of benefit with CoW filesystem snapshots, the overhead is so low that keeping many years of daily backups isn't big deal. (But you've written it, and it seems fairly sane, so I'm prepared to merge it.) Corner cases are harder to deal with when you have a complex expiry method. What happens if the backup isn't run on a particular day, or fails? Do we end up with holes in the backup rotation? Sophisticated expiry schemes can handle these cases. Can you please provide a bit of documentation regarding the the config options. Eg explain are the expiry options additive? ie in your default config keep 8 days of daily, 25 weeklys? Also I think if we're going to ditch Bourne shell compatibility we should change the hash bang to a compatible Thanks |
- Section on retention policies in README.md - Ensure that special TTL only get applied to first (complete) backup of a given day - Introduce EXPIRY_DAY in order to be able to differentiate the (first) daily backup multiple backups at a given day. - Call bash via /usr/bin/env
Hi Andrew, I agree that under error conditions this very simple implementation As nobody is forced to execute the prune script, I think the proposed Unfortunately I can't say yet if I btrfs's COW is sufficient that Another reason why I've expect that getting rid of (hopefully) I've given the documentation a try by adding a section to the README.md You might have misinterpreted my default expiry setting. I've just use I've changed /bin/bash to /usr/bin/env bash Let me know what you think of my changes. Best, Am 22.04.2015 um 04:16 schrieb Andrew Cutler:
|
I've given this some fresh thought, and I think the way I'd like to see this implemented is via arbitrary tags. The tags would be added to the backup when it is taken. And they are used to filter the action of the backup pruner. To implement this the logic would go into the backup runner. It would be responsible for placing tags on backups. |
See #21 as a simpler approach to flexible retention |