Date: Wed, 30 Mar 2005 21:39:22 +1000 From: Stephen McKay <smckay@internode.on.net> To: freebsd-current@freebsd.org Cc: Stephen McKay <smckay@internode.on.net> Subject: Re: Heads up: gtar gone from base system Message-ID: <200503301139.j2UBdMp5016442@dungeon.home> In-Reply-To: <20050329062550.GA69824@cirb503493.alcatel.com.au> from Peter Jeremy at "Tue, 29 Mar 2005 06:25:51 %2B0000" References: <20050327223238.GA749@polands.org> <010401c53385$584a04c0$6800000a@venti> <20050329041527.GA9586@VARK.MIT.EDU> <20050329062550.GA69824@cirb503493.alcatel.com.au>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday, 29th March 2005, Peter Jeremy wrote: >Brian missed a pair of parenthenis. The example should read: > >( cd srcdir ; tar cf - . ) | ( cd destdir ; tar xpf - ) Tar is indeed a most excellent program for copying directory trees, since even in this modern century cp fails to correctly handle hard links. Sigh. Still, if you are using tar, be sure to use it correctly: ( cd srcdir && tar cf - . ) | ( cd destdir && tar xpf - ) You don't want it going off in the current directory and mangling things just because of a little typo in a directory name. Stephen. PS If I'm right, the new tar fixes something gtar got wrong: setting permissions on "." when it is part of the archive, which of course it is when you copy directories in this way. This may surprise new users, even though it is the only sensible result. PPS Who's for adding a "cp -h" option to copy preserving hard links?
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200503301139.j2UBdMp5016442>