I'm using Rsync as a backup tool. When I create a new backup, I would like it to look in all the existing backup folders for each file and if it already exists, create a hard link.
From the Rsync man page,
Beginning in version 2.6.4, multiple --link-dest directories may be provided, which will cause rsync to search the list in the order specified for an exact match.
I could create a list with all my backup folders and pass the list to --link-dest, however I suspect that there must be a better solution.
Can I use a wildcard in the DIR argument of --link-dest? (I tried * but it didn't work).
Can I make
--link-dest search for files recursively? I tried setting DIR to my top backup folder and using
--recursive, but it didn't find the files and it created a new file instead of a hard link.