*BSD News Article 75213


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!usenet.eel.ufl.edu!news.ultranet.com!zombie.ncsc.mil!newsgate.duke.edu!news.mathworks.com!newsfeed.internetmci.com!in2.uu.net!EU.net!ieunet!Ireland.EU.net!Ireland.EU.net!not-for-mail
From: nick@Ireland.EU.net (Nick Hilliard)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Best way to copy directory trees
Date: 1 Aug 1996 17:09:57 +0100
Organization: EUnet Ireland
Lines: 16
Message-ID: <4tqksl$n1m@ezekiel.ieunet.ie>
References: <ts-0108961559090001@mac.infodirekt.de>
NNTP-Posting-Host: ezekiel.ieunet.ie
X-Newsreader: TIN [version 1.2 PL2]

Thomas Schreiber (ts@infodirekt.de) said:
: 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 -cf - foo | (cd destdir; tar xpf -) works better.  If you have GNU cp
lying the place, 'cp -av' does the job nicely.  You could also use some
combination of dump and restore, but that only works for whole filesystems.

Nick
-- 
Nick Hilliard, EUnet Ireland - Phone: +353 1 6790832, Fax: +353 1 6708118