I’m currently using rdiff-backup on a Debian system to perform daily backups via a cron job like so:
rdiff-backup /var/www/html/ /backup/rdiff/html/
However, this approach is generating a large number of backup files. Previously, when I was using rsnapshot, I had different retention intervals configured as follows:
rsnapshot.conf:
retain alpha 6
retain beta 7
retain gamma 4
retain delta 3
And the cron job:
0 */4 * * * /usr/bin/rsnapshot alpha
50 23 * * * /usr/bin/rsnapshot beta
40 23 * * 7 /usr/bin/rsnapshot gamma
30 23 1 * * /usr/bin/rsnapshot delta
How can I implement a similar backup strategy with rdiff-backup, where I have fewer and fewer backups as I go back in time? Specifically, I’d like to keep daily backups for a week, weekly backups for a month, and so on.
I’m aware of the --remove-older-than
option in rdiff-backup, but it doesn’t quite meet my needs. Using –remove-older-than would remove all backups older than a certain point, which isn’t what I’m looking for. I’d like to implement a more nuanced retention policy similar to what I had with rsnapshot.