Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cpt — Apollo

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

DATETIME

6.0b;cpt (copy_tree), revision 6.0b, 87/03/20
CPT (COPY_TREE) -- Copy a directory tree.
usage:  CPT source_pathname target_pathname [-C|-R|-MS|-MD] [-F] [-CHN]
                                        [-AF date] [-BE date] [-DACL|-SACL] [-L]
                                        [-LD] [-SUBS|-NSUBS] [-LF] [-LL] [-LDL]
                                        [-PR pathname...] [-PDT] {CL}


FORMAT

  CPT source_pathname target_pathname ... [options]


  CPT  is  a  multipurpose  tool  for  copying,  merging,  and  replacing files,
  directories, and links.  To copy files only, use CPF (COPY_FILE).


ARGUMENTS

  Multiple source/target pairs and wildcarding are permitted.


  source_pathname
  (required)         Specify the file, link, or directory  tree  to  be  copied.
                     CPT  does not change the contents or link references of the
                     source,  so  errors  that  occur  will  leave  the   source
                     unaffected.

  target_pathname
  (required)         Specify the file or directory tree to be created, replaced,
                     or merged.  The target pathname may  be  derived  from  the
                     source  pathname.  The  target  can  NOT  be  a  link.   In
                     addition, the target can NOT  be  a  logical  volume  entry
                     directory,  or  the  network  root unless the -MD option is
                     specified.


OPTIONS

  Default options are indicated by "(D)."

  -AF date           Copy only objects whose dtms  (date-times)  are  after  the
                     given              date              and              time:
                     [[[yy]yy/]mm/dd][.][hh:mm[:ss]] | TODAY .       The    date
                     defaults  to today, and the time to midnight, if either are
                     omitted from 'date'.

  -BE date           Copy only objects whose dtms are before the given date  and
                     time:  [[[yy]yy/]mm/dd][.][hh:mm[:ss]] | TODAY .   The date
                     defaults to today, and the time to midnight if  either  are
                     omitted from 'date'.

  -C           (D)    Create source at target.  If the file or directory already
                     exists, an error will occur and processing will continue to
                     the  next source/target pair.  Not valid if -MS, -MD, or -R
                     is specified.

                     If the source is a file, CPT copies it to the target.    If
                     the  source is a directory, CPT copies the directory to the
                     target.   It  then  copies  every  file  cataloged  in  the
                     directory (and all subdirectories) until it reaches the end
                     of the tree.

                     Each link name in the source tree is created as a link name
                     in  the  target, but the object that the link references is
                     not  copied.    If  'source_pathname'  is  itself  a  link,
                     however,  the  link  is resolved and the object to which it
                     points is copied to the target.

  -R                 Replace target with source.  Not valid if -C ,-MS,  or  -MD
                     is  specified.  CPT deletes the tree starting at the target
                     pathname and copies the entire source tree  in  its  place.
                     Note  that  the target is deleted BEFORE copying begins. If
                     no target tree by the specified name  exists,  CPT  creates
                     one and duplicates the source.

  -MS                Merge source and target if both are directories.  Not valid
                     if -C or -R is specified.  If the target  does  not  exist,
                     CPT  duplicates  the  source  at the target.  If the target
                     exists, CPT merges the source into  the  target,  replacing
                     files and links, and combining directories.

                     If  both  the  source  and  the target are directories, CPT
                     merges their contents as described below.   Otherwise,  CPT
                     deletes the target and replaces it with the source.

                     To  merge  directories, CPT compares their contents, object
                     by object.  Objects that exist in the source but not in the
                     target  are  created  in the target.  Objects that exist in
                     the target but not in the source  remain  unchanged.  Files
                     and  links  with  the  same name in both the source and the
                     target are deleted from the  target  and  replaced  by  the
                     source  version.    Directories  with the same name in both
                     source and target are merged.  CPT continues  this  process
                     recursively until it reaches the end of the source tree.

  -MD                 Merge  source and target if both are directories.  Similar
                     to -MS except that files and links with the  same  name  in
                     both source and target are left unchanged in the target.

  -F                 Force deletion of target object if 'p' rights are present.

  -DACL        (D)    Apply the target directory's default ACLs.  In addition to
                     its own ACL, each directory has two default ACLs,  one  for
                     its files and another for its subdirectories.  -DACL causes
                     CPT to apply the target directory's default  ACLs  to  each
                     subdirectory  and  file  it copies. The -SACL option causes
                     each object to retain its original ACL.

  -SACL              Retain the source ACL.

  -CHN               Use with -C to change the name of a target before source is
                     copied.    Use if target_name already exists.  Use with -R,
                     -MS, and -MD to change the target_name if target is in use.

  -SUBS        (D)   Retain source ACL for objects which belong to subsystems.

  -NSUBS             Apply the target directory's default ACL for objects  which
                     belong to subsystems.

  -PR pathname        Preserve  the  object  'pathname'  in  target when another
                     object with the same name exists in the source.  Valid with
                     -MS option only.

  -PDT               Preserve the source's modification and used times.

  The  following five options allow you to monitor CPT's operation.  You can use
  -LD, -LF, and -LL in any combination. By default, the listing options apply to
  both  copied  and  deleted  objects. To list only deletions, use -LDL with -L,
  -LD, -LF, or -LL.


  -L                 List all objects as they are copied.

  -LD                List directories as they are copied.

  -LF                List files as they are copied.

  -LL                List links as they are copied.

  -LDL               List only objects deleted as a result of replacements.

  This command uses the command line parser, and so also  accepts  the  standard
  command options listed in HELP CL.












EXAMPLES

  1.  $ cpt /com /com.backup -r         Copy the directory tree "/com"
                                         to "/com.backup" replacing the
                                         existing "/com.backup" tree.

  2.  $ cpt my_circuits /circuits -ms    Merge the directory tree
                                         "my_circuits" into the
                                         "/circuits" tree.


RELATED TOPICS

  More information is available.  Type:

  - HELP DATETIME
   for more information on date-time syntax used with -AF and -BE.

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026