-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
rsync -vai --lin-dest=/path/to/source/ /path/to/source/ /path/to/target/
Note that if you try it with relative paths the link-dest will be
relative to the source not .
On 06/18/13 09:39, Chris Dennis wrote:> Hello rsync people
>
> I thought I knew how to use rsync, but I can't work out how to use
> it to do the equivalent of
>
> cp -al dir1 dir2
>
> where dir1 and dir2 are both local and on the same disk.
>
> In other words I want to make dir2 a copy of dir1, with every file
> hard-linked to its counterpart in dir1.
>
> Why not just use cp? Because I want to be able to do it as a user
> who has sudo permission to run rsync but not cp.
>
> cheers
>
> Chris
- --
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
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: http://www.sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
iEYEARECAAYFAlHAaIgACgkQVKC1jlbQAQcKLQCfSaHopk/J2bhPCUFuwR3KSIMM
daQAnjpVXhgeRz0bvb2/ttKVNZHAmuq6
=5f7j
-----END PGP SIGNATURE-----