From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 1 12:44:04 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1457116A4DA for ; Tue, 1 Aug 2006 12:44:04 +0000 (UTC) (envelope-from anderson@centtech.com) Received: from mh1.centtech.com (moat3.centtech.com [207.200.51.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 11C9743D77 for ; Tue, 1 Aug 2006 12:43:59 +0000 (GMT) (envelope-from anderson@centtech.com) Received: from [10.177.171.220] (neutrino.centtech.com [10.177.171.220]) by mh1.centtech.com (8.13.1/8.13.1) with ESMTP id k71Chw6V005832 for ; Tue, 1 Aug 2006 07:43:59 -0500 (CDT) (envelope-from anderson@centtech.com) Message-ID: <44CF4C9F.3040101@centtech.com> Date: Tue, 01 Aug 2006 07:44:15 -0500 From: Eric Anderson User-Agent: Thunderbird 1.5.0.4 (X11/20060612) MIME-Version: 1.0 To: FreeBSD Hackers References: <44C82A40.3020009@centtech.com> In-Reply-To: <44C82A40.3020009@centtech.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.87.1/1629/Tue Aug 1 06:19:34 2006 on mh1.centtech.com X-Virus-Status: Clean Subject: Re: [PATCH] adding two new options to 'cp' (UPDATE) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Aug 2006 12:44:04 -0000 On 07/26/06 21:51, 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/ > > 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 I've made an updated patch available. It fixes the missing information in the usage output, a file descriptor leak, and also now warns when an attempt to copy a socket occurs instead of erroring. This isn't really particular to any of the new arguments, but is more consistent with other tools, and consistent with cp's other options that just warn. The new patch can be found here: http://www.googlebit.com/freebsd/patches/cp-patch-2 Eric -- ------------------------------------------------------------------------ Eric Anderson Sr. Systems Administrator Centaur Technology Anything that works is better than anything that doesn't. ------------------------------------------------------------------------