1 .\" (c) Copyright 1997-1999 by Matthew Dillon and Dima Ruban. Permission to
2 .\" use and distribute based on the DragonFly copyright. Supplied as-is,
3 .\" USE WITH EXTREME CAUTION.
6 .\" $DragonFly: src/bin/cpdup/cpdup.1,v 1.13 2006/07/13 13:34:12 swildner Exp $
12 .Nd mirror filesystems
47 utility makes an exact mirror copy of the source in the destination, creating
48 and deleting files and directories as necessary. UTimes, hardlinks,
49 softlinks, devices, permissions, and flags are mirrored. By default,
51 asks for confirmation if any file or directory needs to be removed from
52 the destination and does not copy files which it believes to have already
53 been synchronized (by observing that the source and destination file's size
56 does not cross mount points in either the source or the destination.
59 refuses to replace a destination directory with a file.
61 The following options are available:
64 Set verboseness. By default
66 does not report its progress except when asking for confirmation. A single
68 will only report modifications made to the destination.
70 will report directories as they are being traversed as well as
71 modifications made to the destination.
73 will cause all files and directories to be reported whether or not
74 modifications are made.
76 Causes the ouptut generated by
79 This can be useful for obtaining prompt progress updates through a pipe.
81 will cause cpdup to print a summary at the end with performance counter.
83 Forces file updates to occur even if the files appear to be the same. If
86 option is used, this option will also force a byte for byte comparison
87 between the original file and the file in the hardlink path, even if
88 all the stat info matches, but will still use a hardlink if they match.
90 Disable the disallow-file-replaces-directory safety feature. This
91 safety feature is enabled by default to prevent user mistakes from blowing
92 away everything accidently.
94 Do not request confirmation when removing something.
98 Do not remove any files, just overwrite/add.
100 Generate and maintain a MD5 checkfile in each directory on the source
101 and do an MD5 check on each file of the destination when the destination
102 appears to be the same as the source. If the check fails,
104 the source is recopied to the destination. When you specify a destination
105 directory the MD5 checkfile is only updated as needed and may not be updated
106 even if modifications are made to a source file. If you do not specify a
107 destination directory the
109 command forcefully regenerates the MD5 checkfile for every file in the source.
111 cpdup will create a hardlink from a file found under
113 to the target instead of copying the source to the target if the file found
116 is identical to the source. This allows one to use
118 to create incremental backups of a filesystem. Create a direct 'level 0'
119 backup, and then specify the level 0 backup path with this option when
120 creating an incremental backup to a different target directory.
121 This method works so long as the filesystem does not hit a hardlink limit.
122 If the system does hit a hardlink limit
124 will generate a warning and copy the file instead.
127 must record file paths for any hardlinked file while operating and therefore
128 uses a great deal more memory when dealing with hardlinks or hardlink-based
129 backups. Example use:
131 .Dl cpdup -i0 -s0 -I -H /backup/home.l0 /home /backup/home.l1
133 WARNING: If this option is used
135 must record the paths for all files it encounters while it operates
136 and it is possible that you may run the process out of memory.
140 but allows you to specify the name of the MD5 checkfile.
142 Generate and maintain a FSMID checkfile called .FSMID.CHECK in each
143 directory on the target.
145 will check the FSMID for each source file or directory against the checkfile
146 on the target and will not copy the file or recurse through the directory
147 when a match occurs. Any source file or directory with the same name as the
148 checkfile will be ignored. The FSMID will be re-checked after the copy
149 has been completed and
151 will loop on that directory or file until it is sure it has an exact copy.
153 Warning: FSMID is not always supported by a filesystem and may not be
154 synchronized if a crash occurs. DragonFly will simulate an FSMID when
155 it is otherwise not supported by the filesystem, and users should be aware
156 that simulated FSMIDs may change state in such cases even if the underlying
157 hierarchy does not due to cache flushes.
158 Additionally, the FSMID may not reflect changes made to remote filesystems
159 by other hosts. For example, using these options with NFS mounted sources
164 but allows you to specify the name of the FSMID checkfile.
168 to use the exclusion file ".cpignore" in each directory on the source to
169 determine which files to ignore. When this option is used, the exclusion
170 filename itself is automatically excluded from the copy. If this option is
171 not used then the filename ".cpignore" is not considered special and will
172 be copied along with everything else.
176 but allows you to specify the name of the exclusion file. This file is
177 automatically excluded from the copy. Only one exclusion file may be
183 utility exits 0 if no error occured and >0 if an error occured.
189 UFS has a hardlink limit of 32767. Many programs, in particular CVS
190 with regards to its CVS/Root file, will generate a lot of hard links.
193 option it may not be possible for
195 to maintain these hard links. If this occurs
197 will be forced to copy the file instead of link it, and thus not be able
198 to make a perfect copy of the filesystem.
202 command was original created to update servers at BEST Internet circa 1997
203 and was placed under the FreeBSD copyright for inclusion in the ports area
204 in 1999. The program was written by Matthew Dillon and Dima Ruban.