At my company we create daily backups (full, not incremental) of our various stuff. We'd like to rotate them in the following way:
- keep daily backups for the past week
- keep only weekly backups for the past month (or 3 months or so)
- keep only monthly backups for the last year
So basically, recent backups should be fine-grained, not so recent – more coarse grained.
And we're lazy 🙂 Can this be done with logrotate? Or some other tool?
Regards,
Mike
Best Answer
You can schedule one or more scripts like the one below with cron.
This needs just a little bit of tweaking to server your requests.