Working on Debian 10. Seeing that rdiff-backup has stopped development for quite some time, I'd like to move on my backup-needs to rsync. However, there is one feature of rdiff-backup that I am not prepared to give up:
--remove-older-than 6M
That option will delete files from destination if they have not existed in the source for longer than 6 months.
Is there either
- a way to do this in rsync? Or
- some other more modern, scriptable backup-tool for Linux that offers that function?
Best Answer
I strongly suggest using an
rsync
based tool calledrsnapshot
: it supports defining specific retention policies, with automatic rotation and deletion.If you want to use
rsync
only, you need to find and delete files older than 6 months via thefind
utility - ie: something asfind /your/dir -mtime +180 -daystart -delete
.DISCLAIMER: Before using the
-delete
subcommand, be sure to test yourfind
command to triple-check it does not select unwanted files.