Sys V does not have a recursive copy cmd...

James Van Artsdalen james at bigtex.uucp
Sat Jan 10 05:17:25 AEST 1987


IN article <487 at obelix.UUCP>, sven-e at obelix.UUCP (Sven L Eriksson) wrote:
> In article <1964 at ptsfa.UUCP> jmc at ptsfa.UUCP (Jerry Carlin) writes:
> >Try "find . -print|cpio -pduvm /foo/bar/...".

> Another way to do this copy is to use tar. (Tape file ARchiver)

> 	tar cf - . | (cd todir ; tar xf - )

> If you use this command links between files in the tree will be kept.
> Otherwise it will work exactly as the find|cpio version.

I believe cpio will always maintain links between trees.  If the "-l" option
is given to the "cpio -p..." above, then cpio will link the new files if
possible, making it analogous to a tree oriented ln.  In this last case
cpio is certainly faster than tar iff the source and destinations are on
the same file system.  Even if cpio cannot simply link the new files to the
old ones I would except cpio to be quite a bit faster, because the cpio
moves much less data through the pipe than the tar method does, and running
one copy of cpio -p presumably has less overhead than two copies of tar.
-- 
James R. Van Artsdalen   ...!ut-sally!utastro!bigtex!james   "Live Free or Die"
Voice: (512)-323-2675  Modem: (512)-323-2773  5300B McCandless, Austin TX 78756



More information about the Comp.unix.questions mailing list