On Tue, 15 Jul 1997, Bob Clark wrote:

:Syd Alsobrook wrote:
:>
:> Really easy
:>
:> The best way to copy a directory tree from one drive to another is
:>
:>         cp -pr /usr /hd
:>
:> Thanks
:>
:> Syd
:> ----
:
:Hmm... The _best_ way?  I not so sure.  Like most things in
:*nix where there are lots of ways to get the job done there
:is usually not a _best_ way.  A major problem with cp -pr is
:that linked-files, both hard and soft, are broken and all
:links are copied individually as regular files.  This can
:cause MAJOR problems as well as consuming more disk space.

Also, the cp command doesn't always do so well with device files, fifos,
etc.  The tar command has some of these problems as well.

:A couple of ways to avoid this problem are:
:
:mkdir newDir
:cd oldDir
:find . -print | cpio -pdm newDir

This is my preferred method, except I usually do a cpio -padm ... makes
it a little more transparent that things have been moved.  Aethetics,
mostly. 

:
:    OR
:
:mkdir newDir
:cd newDir
:(cd oldDir;tar cf - .) | tar xpf -

This won't work on the /dev directory, I don't think.

:I'm sure these are not the _best_ way, but as far as I know
:there are no hidden side-effects with links, permissions,
:etc.
:
:My $0.02
:--Bob


--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
[EMAIL PROTECTED] . 
Trouble?  e-mail to [EMAIL PROTECTED] .

Reply via email to