Can I hard link files with rsync instead of copying them?
The answer has turned out to be yes, with rsync's --link-dest
option. It's just not obvious because it's not a simple on/off flag like cp -l
, because it takes a path argument.
So, cp -l a/ b/
can also be done like this:
rsync -a --link-dest=a a/ b/