I'm in need of a command line tool much like rsync to do an exact copy of a specified folder. (Meaning all the files, that were deleted in the source folder shall also be deleted in the target folder)
I know this can be done using something like:
rsync -a --delete /source/folder /target/folder
I'd prefer a slightly different behaviour
Files should only be deleted if there is no space left on the target. With other words: Only as many files as necessary should be deleted. (It would be a great bonus if the files that were only deleted a short time ago in the source directory survive longest in the target directory)
I'd like to use this as a backup tool - So if a files gets deleted in the source directory there'd be at least a slight chance that it would still be there in the target directory.
Is there anything like that? (Is it probably just another rsync parameter I missed?)