rsync equivalent of 'cp -al' ?
Chris Dennis
cgdennis at btinternet.com
Tue Jun 18 09:49:52 MDT 2013
On 18/06/13 15:02, Kevin Korb wrote:
> -----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 .
Thank you Kevin.
I'd forgotten that --link-dest needed a relative path. This works for me:
rsync -Haxv --stats --link-dest ../dir1 dir1/ dir2
The / on the end of the second dir1 is, of course, essential.
cheers
Chris
>
> 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-----
>
--
Chris Dennis cgdennis at btinternet.com
Fordingbridge, Hampshire, UK
More information about the rsync
mailing list