A really nice feature (since rsync is used quite a lot for backups) would be to have a command line option to only delete/prune files when they expire rather than as soon as they are non-existent on the source host. For example, using --delete-during will delete any files on the destination host that are no longer on the source host. However, it might have been a mistake to remove the file on the source host or perhaps its not present due to hardware failure (many scenarios spring to mind). If a nightly rsync backup is in operation then the files will be lost forever on both the source and destination hosts on the day of deletion. With an option like: --delete-expiry 30 ...could ensure files are only deleted/pruned if they no longer exist on the source host AND that their modification time on the destination host is older than (in this example) 30 days. Exactly like this: find /src -type f -mtime +30 -exec rm -f {} \; One flaw is that you could potentially delete a file on the source host that has already expired on the destination host, but for the majority of files accessed frequently you can be rest assured you will still have a few days to retrieve the file before its gone forever.
This approach to keeping old versions of files around is not very general: it handles only deletions, and then only if the file happened to be modified in the 30 days before the deletion (as you noted). I don't think support for this will be added to rsync. The recommended approach is to maintain a rotating series of hard-linked backups using --link-dest. There are several programs that will do this for you, such as rsnapshot.