
Russell Coker <russell@coker.com.au> writes:
Does anyone know of a good script for managing btrfs snapshots for different frequencies of backups? [...] like every 15 minutes for the last 24 hours, every 8 hours for the previous 30 days, and every day for the 100 days before that.
Actually taking the backups is trivial - a fifteen minute cron job. At the end of that job, you expire any snapshots that are superfluous to your rotation policy -- e.g. if it's four hourlies and seven dailies, then you expire the fifth hourly &c My immediate inclination would be to rip the code for that out of rsnapshot. However IIRC that relies heavily on the snapshots being named <rotation>.<Nth>, which is why at Cyber we have an in-house Python script for expiring superfluous ZFS snapshots. If you're interested, let me me know and I'll see if I can publish it (it's not my code so I have to ask first.)