Equivalent between rsync -aHr and cp -al

jw schultz jw at pegasys.ws
Thu Jan 22 18:56:04 GMT 2004

On Thu, Jan 22, 2004 at 06:19:06PM +0900, Charles Nadeau wrote:
> Hi,
> Just a quick question. I am looking for a replacement for the command "cp
> -al" which has problems dealing with a massive amount of files
> (http://mail.gnu.org/archive/html/bug-coreutils/2003-12/msg00028.html).
> Could I use "rsync -aHr" to do _exactly_ the same thing as "cp -al"?

No.  The -H (--hard-links) option is only to replicate
internal linkages not make external ones.  That is, if a/b
is linked to a/c and you do "rsync -aH a/ z"  z/b will be
linked with z/c but not to a.  Rsync's --link-dest option
could be twisted to accomplish that but i'd be flabbergasted
if any currently released version of rsync used less memory
than cp.

I'd suggest trying cpio's pass-through mode

	cd $src; find . | cpio -pl $dest

on the chance that cpio might be a little more efficient
about link tuples than cp.

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at pegasys.ws

		Remember Cernan and Schmitt

More information about the rsync mailing list