10.0;cpt (copy_tree), revision 1.0, 88/01/18
cpt (copy_tree) -- Copy a directory tree.
usage: cpt source_pathname target_pathname
[-p] [-c|-r|-ms|-md]
[-f] [-chn]
[-af date]
[-be date]
[-dacl|-sacl]
[-subs|-nsubs]
[-pr] [-pdt]
[-cwl] [-conv]
[-l] [-ld] [-lf]
[-ll] [-ldl]
DESCRIPTION
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, however while
you can use a wildcard with the source argument, you cannot with the
destination.
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 leave the source unaffected.
target_pathname (required)
Specify the file or directory tree to be created,
replaced, or merged. target_pathname may be derived from
the source pathname. The target cannot be a link. In
addition, the target cannot be a logical volume entry
directory, or the network root unless the -md option is
specified.
OPTIONS
-p[airwise] Instructs cpt to accept the list of tokens as consecutive
pairs. This is necessary whether you are using wildcards
or not.
-af date Copy only objects whose DTMs (date-times) are after the
given date and time: [[[yyyy/]mm/dd][.][hh:mm[:ss]] |
today. The date defaults to today, and the time to
midnight, if either is 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 is
omitted from date.
-c (default) Create source at target. If the file or directory already
exists, an error occurs and processing continues 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 (default)
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 Retains the source object's original ACL. This is subject
to the limitations imposed by the security model selected
by the system administrator. If the user is not
privileged, then the copy is subject to the normal
restrictions imposed when assigning ACLs to a file.
If the attempt to copy the ACL fails, the target object is
deleted.
-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 (default)
Retain source ACL for objects that belong to subsystems.
This is subject to the limitations imposed by the security
model selected by the system administrator. If the file is
stamped as protected subsystem data or a protected
subsystem manager, and the user is not privileged, then
the copy of the source object fails and the target object
is deleted.
-nsubs Apply the target directory's default ACL for objects that
belong to subsystems.
-pr pathname Preserve the object pathname in the 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.
-cwl Obtain a co-writer's instead of an exclusive lock on files
being copied.
-conv[ert] Set the owner entry in the target from the first
person.%.% entry in the source with P rights. The first
%.group.% entry in the source becomes the group entry in
the target, and the first %.%.org entry in the source
becomes the organization entry in the target.
Used with the -conv option, cpf, cpt, and acl duplicate
Domain/IX behavior. Their default behavior is to turn
SR9.7 ACLs into SR10 extended entries. For more
information on SR10 behavior, see Managing Aegis System
Software.
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.
NOTES
If you use more than one pair of name tokens with this command, you must
use the -p option. It instructs the command to accept the list of tokens
as consecutive pairs. This is necessary whether you are using wildcards
or not. In the past, this command has correctly paired off tokens without
the prompting of a switch; now the -p switch must be used to acheive this
result. The switch has been added to protect against inadvertent use in
a shell, other than /com/sh, where wildcard expansion can be a problem.
Five conditions always terminate execution:
⊕ An attempt to use the network root or node entry directory as a
target, without specifying a merge.
⊕ An error in reading the top level of the source tree.
⊕ An attempt to create an existing directory (if the target is an
existing directory, you must specifiy -r or -m).
⊕ The logical volume containing the target directory is full.
⊕ A quit or stop fault in the process.
EXAMPLES
Copy the directory tree /com to /com.backup replacing the existing
/com.backup tree.
$ cpt /com /com.backup -r
Merge the directory tree mycircuits into the /circuits tree.
$ cpt mycircuits /circuits -ms
SEE ALSO
More information is available. Type
help datetime For more information on date-time syntax used with -af and
-be