1BSD/man6/cptree.6

.th CPTREE VI 8/22/77
.sh NAME
cptree \- make a duplicate tree
.sh SYNOPSIS
.bd cptree
[
.bd \-
] [
.bd \-y
] [
.bd \-q
]
source dest
.sh DESCRIPTION
A copy of the tree rooted at
.it source
is made with its root at
.it dest.
The existing link structure of the subtree is preserved.
.it Dest
must already exist.
The source and destination directories need not be on the same device,
but the subtree must encompass only one device.
If the source and destination directories are on the same device
.it lntree
(VI)
would run much faster, but will have a very different effect
unless
.it source
is to be removed, e.g. with
.it rmtree
(VI).
.s3
.it Cptree
diagnoses the fact
that
.it dest
is a subdirectory of
.it source,
and does no copying as such would not terminate.
.s3
.it Cptree
first makes a pass at the subtree rooted at source, checking that it
can indeed transverse the directory structure and copy all the named files.
It checks on the prepass for
.it dest
a subdirectory of
.it source
and also records
the inode numbers of files it encounters which have link counts greater
than 1.
It will complain on this pass and forego pass 2 if it finds any
unreadable subdirectories,
any files it will not be able to copy,
or any special files.
.s3
After this prepass,
if there are any files whose link count is not totally
accounted for in the subtree rooted at source,
.it cptreee
lists the inode number
of each together with the number of dangling links and all known names for
the inode.
The user is then asked to confirm that the copy is still to be made.
The
.bd \-y
option can be used to answer this question affirmatively on the
command line.
The question is not asked if the standard input is not a teletype.
The
.bd \-
option suppresses all link diagnositics and prompting and makes the new tree
regardless.
.s3
.it Cptree
finally makes a second pass, forking a
.it cp
(I) to do each copy,
and linking via
.it ln
(II)
when appropriate.
.s3
For the super-user
.it cptree 
normally makes new quota files with the same
maximum quota as in the source tree.
This feature is disabled by the 
.bd \-q
option.
If the super-user is copying, the ownership of each file in the copy
corresponds to that in the original.
.sh "SEE ALSO"
mkdir (I), quot(I), cp (I), ln(II), cpall(VI), lntree(VI), rmtree(VI)
.sh AUTHOR
William Joy
.sh BUGS
Missing link information, while potentially useful,
is rarely a concern, so that the prompting for confirmation
when links are ``dangling''
is most often a nuisance.