CPTREE(VI) − PWB/UNIX 8/22/77
NAME
cptree − make a duplicate tree
SYNOPSIS
cptree [ − ] [ −y ] [ −q ] source dest
DESCRIPTION
A copy of the tree rooted at source is made with its root at dest. The existing link structure of the subtree is preserved. 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 lntree (VI) would run much faster, but will have a very different effect unless source is to be removed, e.g. with rmtree (VI). Cptree diagnoses the fact that dest is a subdirectory of source, and does no copying as such would not terminate. 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 dest a subdirectory of 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. After this prepass, if there are any files whose link count is not totally accounted for in the subtree rooted at source, 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 −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 − option suppresses all link diagnositics and prompting and makes the new tree regardless. Cptree finally makes a second pass, forking a cp (I) to do each copy, and linking via ln (II) when appropriate. For the super-user cptree normally makes new quota files with the same maximum quota as in the source tree. This feature is disabled by the −q option. If the super-user is copying, the ownership of each file in the copy corresponds to that in the original.
SEE ALSO
mkdir (I), quot(I), cp (I), ln(II), cpall(VI), lntree(VI), rmtree(VI)
AUTHOR
William Joy
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.