Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jul 2006 20:51:13 -0700
From:      Julian Elischer <julian@elischer.org>
To:        Eric Anderson <anderson@centtech.com>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: [PATCH] adding two new options to 'cp'
Message-ID:  <44C83831.5050900@elischer.org>
In-Reply-To: <44C82A40.3020009@centtech.com>
References:  <44C82A40.3020009@centtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eric Anderson wrote:

> I'm tired of trying to use rsync or gcp (which doesn't like symlinks 
> often) to copy trees of files/directories using hard links, so I added 
> the gcp-ish options -a and -l.
>
> -a is 'archive' mode, which is just a quick form of -PpR.
> -l is 'link' mode, where regular files get hard linked instead of copied.
>
> So, you can mimic an entire tree with something like:
>
> cp -al /from/ /to/


I've always used:
find . -depth |cpio -pdlmv $dest
(fully portable)  but your addition can't hurt (well it might make the 
larger program load a bit slower
but it isn't that much.)

>
> and it's fast too!
>
> Patch is against 6-STABLE, but works well on 7-CURRENT as well.
>
> Patch is here (with man page edits):
> http://www.googlebit.com/freebsd/patches/cp-patch
>
> cd /tmp/
> fetch http://www.googlebit.com/freebsd/patches/cp-patch
> cd /usr/src/
> patch < /tmp/cp-patch
> cd bin/cp
> make && make install
>
> Patch was done for rsnapshot users mainly (there are quite a few of us).
>
> Comments? Flames? Committers willing to commit?
>
> Eric
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44C83831.5050900>