[comp.unix.questions] Recursive copy

chip@ateng.com (Chip Salzenberg) (11/22/89)

According to Kemp@DOCKMASTER.NCSC.MIL:
>Just for the record, is there *any* way to do a recursive copy
>correctly?  I.e.  one that doesn't:
>
> * turn symbolic links into actual files
> * turn link loops into a series of infinitely nested copies
> * alter the modify and change times
> * choke on block and character special files
> * turn holes in sparse files into real disk blocks

If you've got SCO Xenix, "copy -rom" will copy special files correctly and
preserve access and modification times.
-- 
You may redistribute this article only to those who may freely do likewise.
Chip Salzenberg at A T Engineering;  <chip@ateng.com> or <uunet!ateng!chip>
    "Did I ever tell you the Jim Gladding story about the binoculars?"

evans@testmax.ZK3.DEC.COM (Marc Evans Ultrix Q/A) (12/04/89)

I can think of a couple of different ways to solve your problem.

Option 1:

cd $directory_to_copy
cpio -padvm . $target_directory_name

Option 2:

cd $directory_to_copy
tar cf - | (cd $target_directory_name && tar xvf -)

==========================================================================
Marc Evans - WB1GRH - evans@decvax.DEC.COM  | Synergytics    (603)893-8481
     Unix/X-window Software Contractor      | 3 Koper Ln, Pelham, NH 03076
==========================================================================