*BSD News Article 75212


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.eng.convex.com!newshost.convex.com!bcm.tmc.edu!cs.utexas.edu!uwm.edu!lll-winken.llnl.gov!enews.sgi.com!news.mathworks.com!nntp.primenet.com!news1.best.com!nntp1.best.com!not-for-mail
From: rone@bofh.noc.best.net (Ron Echeverri)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Best way to copy directory trees
Date: 1 Aug 1996 08:51:01 -0700
Organization: fidgety systems administrators gmbh
Lines: 23
Message-ID: <4tqjp5$eip@bofh.noc.best.net>
References: <ts-0108961559090001@mac.infodirekt.de>
NNTP-Posting-Host: bofh.noc.best.net

In article <ts-0108961559090001@mac.infodirekt.de>,
Thomas Schreiber <ts@infodirekt.de> wrote:
>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 -)
>but both seem to not exactly preserve directory trees.

From the cp man page:

COMPATIBILITY
     Historic versions of the cp utility had a -r option.  This implementation
     supports that option, however, its use is strongly discouraged, as it
     does not correctly copy special files, symbolic links or fifo's.

So, as someone else suggested to you, you should use cp -pR instead.

rone
-- 
 Ron Echeverri        Best Internet Systems Administration        rone@best.net
 ------------------------------------------------------------------------------
                  Must...  control...  fist...  of...  death...