rsync equivalent of 'cp -al' ?

Kevin Korb kmk at sanitarium.net
Tue Jun 18 09:53:09 MDT 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The -H there isn't needed and could only cause increased memory usage.


On 06/18/13 11:49, Chris Dennis wrote:
> On 18/06/13 15:02, Kevin Korb wrote: 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/

iEYEARECAAYFAlHAgmUACgkQVKC1jlbQAQf8nwCePHOSo1b6BFhzQSb0KSUwxJec
ErkAoNZey1UBaIVcAFPe8gMkoMSpZhuF
=uXd/
-----END PGP SIGNATURE-----


More information about the rsync mailing list