*BSD News Article 75235


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!metro!metro!asstdc.scgt.oz.au!nsw.news.telstra.net!act.news.telstra.net!psgrain!iafrica.com!pipex-sa.net!plug.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.be.innet.net!INbe.net!news.nl.innet.net!INnl.net!hunter.premier.net!news-res.gsl.net!news.gsl.net!news.mathworks.com!newsfeed.internetmci.com!howland.reston.ans.net!EU.net!usenet2.news.uk.psi.net!uknet!usenet1.news.uk.psi.net!uknet!psinntp!psinntp!psinntp!gl
obe.internetkorea.com!pubxfer.news.psi.net!dan.emsphone.com!not-for-mail
From: dan@dan.emsphone.com (Dan Nelson)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Best way to copy directory trees
Date: 1 Aug 1996 16:04:43 GMT
Organization: Executive Marketing Services, Inc.
Lines: 22
Message-ID: <4tqkir$mu4@client2.news.psi.net>
References: <ts-0108961559090001@mac.infodirekt.de>
Reply-To: dnelson@emsphone.com (Dan Nelson)
NNTP-Posting-Host: 199.67.51.101
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 8bit
X-Newsreader: TIN [UNIX 1.3 unoff BETA release 960618]

Thomas Schreiber <ts@infodirekt.de> wrote:
> I have installed a second drive on my FreeBSD 2.1 machine
> and want to move a few file systems around now.

> What is the best way to copy directory trees with preserving
> access dates, permissions, links and so on?

> I know about

>   cp -pr
>   tar cf - | (cd destdir; tar xf -)

Tar should be the fastest method, as you are using one process per
drive so you get I/O on both drives at the same time.

What's the difference betwwen the src and dest directories?  Tar should
handle hard/soft links, dates, and permissions.  You might have to do a
"tar xfp -" to "extract all protection information", according to the
man page.

	-Dan Nelson
	dnelson@emsphone.com