

cpdir                        Command                        cpdir




Copy directory hierarchy

ccppddiirr [_o_p_t_i_o_n ... ] _d_i_r_1 _d_i_r_2

cpdir copies source  directory hierarchy dir1 to target hierarchy
dir2, which is created if necessary.  Either hierarchy may strad-
dle device boundaries.

cpdir  preserves as  much as  possible  of the  source structure.
Files under dir1 go to identically named files under dir2.  Links
between source files are preserved as links between corresponding
target  files.  Preserved  source file  attributes  include mode,
subject to the user's file creation mask.  If the user is not the
superuser,  cpdir cannot  preserve the  owner, group,  and sticky
bits in the mode, and the invoking user owns all new files; under
the superuser  it preserves these as well.   In addition, the su-
peruser may  ``copy'' special nodes and  pipe nodes; cpdir copies
only  the facility,  not the  contents.   It also  preserves real
major and minor device numbers of special nodes.

If the  target file corresponding to a source  file exists and is
not a  directory, cpdir unlinks it  before copying.  This differs
from the action of cp.

cpdir recognizes the following options:

-aa   Give a verbose account on one line of the files copied.

-dd   Preserve the last-modified date instead of using the present
     date.

-ee   Print  error message and continue  execution after an error.
     The default action is to exit on any error.

-rr [_n]
     Descend no more than n levels in the source hierarchy.  Con-
     tents of dir1 are at level 1.  If missing, n defaults to 1.

-ss _n_a_m_e
     Suppress the copy of file name, which should be the pathname
     of the file relative to dir1.

-tt   Test only, make  no changes.  With this option, cpdir prints
     a report of all  errors (-e is implied), all unlinked target
     files, and other  useful information, including a summary of
     all external links into the target hierarchy that would have
     been broken had the unlinking actions been executed.

-uu    Update  regular files.   Copy  the source  only  if it  was
     created or altered more recently than the target file, or if
     the target does not exist.

-vv    Print a  verbose account  of its  activities.  cp  prints a
     file-by-file account of  its actions, in addition to the in-


COHERENT Lexicon                                           Page 1




cpdir                        Command                        cpdir



     formation listed under -t.

***** See Also *****

cp, commands, link(), umask(), unlink()




















































COHERENT Lexicon                                           Page 2


