Question about rsync -uav dir1/. dir2/.: possib to link?
kmk at sanitarium.net
Sat Sep 4 23:55:55 UTC 2021
Rsync does almost everything cp does but since it is designed to network
it never got that feature. I was thinking maybe --link-dest could be
tortured into doing it but if it can I can't figure out how. BTW, you
have some pointless dots in there.
On 9/4/21 6:41 PM, L A Walsh via rsync wrote:
> I noticed in looking at download dirs for a project, that
> another mirror had "crept-in" for usage (where different mirrors
> are stored under mirror-URL names). To copy over the diffs,
> normally I'd do:
> rsync -uav dir1/. dir2/.
> (where dir1="the new mirror that I'd switched
> to by accident, and dir2=the original dir).
> The files were "smallish" so I just copied them, BUT I wass
> wondering if there was an option similar to using 'cp' for
> a dircopy, but instead of
> cp -a dr1 dr2
> cp -al dr1 dr2
> to just hard-link over files from "dir1" to "dir2" (both
> are on the same file system).
> I looked at (and tried) --link-dest=DIR
> (hardlink to files in DIR when unchanged), but either I had the syntax
> wrong, or didn't understand it as it didn't seem to do what I
> wanted: cp'ing the new files in dir1 into the orig dir).
> Does rsync have an option to just "copy" over the new
> files via a hardlink?
Kevin Korb Phone: (407) 252-6853
Systems Administrator Internet:
FutureQuest, Inc. Kevin at FutureQuest.net (work)
Orlando, Florida kmk at sanitarium.net (personal)
Web page: https://sanitarium.net/
PGP public key available on web site.
More information about the rsync