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. 4.\" 5.\" 6.\" $DragonFly: src/bin/cpdup/cpdup.1,v 1.2 2003/12/01 06:07:16 dillon Exp $ 7.Dd October 28, 1999 8.Dt CPDUP 1 9.Os BSD 4 10.Sh NAME 11.Nm cpdup 12.Nd mirror filesystems 13.Sh SYNOPSIS 14.Nm cpdup 15.Op Fl v[vv..] 16.Op Fl I 17.Op Fl f 18.Op Fl s0 19.Op Fl i0 20.Op Fl q 21.Op Fl o 22.Op Fl m 23.Oo 24.Fl M 25.Ar file 26.Oc 27.Oo 28.Fl X 29.Ar file 30.Oc 31.Op Fl x 32.Ar source_dir 33.Ar target_dir 34.Sh DESCRIPTION 35The 36.Nm 37utility makes an exact mirror copy of the source in the destination, creating 38and deleting files and directories as necessary. UTimes, hardlinks, 39softlinks, devices, permissions, and flags are mirrored. By default, 40.Nm 41asks for confirmation if any file or directory needs to be removed from 42the destination and does not copy files which it believes to have already 43been synchronized (by observing that the source and destination file's size 44and mtimes match). 45.Nm 46does not cross mount points in the source but may cross mount points in the 47destination. As a safety measure, 48.Nm 49refuses to replace a destination directory with a file. 50.Pp 51The following options are available: 52.Bl -tag -width flag 53.It Fl v[vvv] 54Set verboseness. By default 55.Nm 56does not report its progress except when asking for confirmation. A single 57.Fl v 58will only report modifications made to the destination. 59.Fl vv 60will report directories as they are being traversed as well as 61modifications made to the destination. 62.Fl vvv 63will cause all files and directories to be reported whether or not 64modifications are made. 65.It Fl I 66will cause cpdup to print a summary at the end with performance counter. 67.It Fl f 68Forces file updates to occur even if the files appear to be the same. 69.It Fl s0 70Disable the disallow-file-replaces-directory safety feature. This 71safety feature is enabled by default to prevent user mistakes from blowing 72away everything accidently. 73.It Fl i0 74Do not request confirmation when removing something. 75.It Fl q 76Quiet operation 77.It Fl o 78Do not remove any files, just overwrite/add. 79.It Fl m 80Generate and maintain an MD5 checkfile in each directory on the source 81and do an MD5 check on each file of the destination when the destination 82appears to be the same as the source. If the check fails, 83.Nm 84the source is recopied to the destination. When you specify a destination 85directory the MD5 checkfile is only updated as needed and may not be updated 86even if modifications are made to a source file. If you do not specify a 87destination directory the 88.Nm 89command forcefully regenerates the MD5 checkfile for every file in the source. 90.It Fl M 91Works the same as 92.Fl m 93but allows you to specify the name of the MD5 checkfile. 94.It Fl x 95Causes 96.Nm 97to use the exclusion file ".cpignore" in each directory on the source to 98determine which files to ignore. When this option is used, the exclusion 99filename itself is automatically excluded from the copy. If this option is 100 not used then the filename ".cpignore" is not considered special and will 101 be copied along with everything else. 102.It Fl X 103Works the same as 104.Fl x 105but allows you to specify the name of the exclusion file. This file is 106automatically excluded from the copy. Only one exclusion file may be 107specified. 108.Sh DIAGNOSTICS 109The 110.Nm 111utility exits 0 if no modifications were made, and >0 if modifications 112were made to the destination. 113.Sh SEE ALSO 114.Xr cp 1 , 115.Xr cpio 1 , 116.Xr tar 1 , 117.Sh HISTORY 118The 119.Nm 120command was original created to update servers at BEST Internet circa 1997 121and was placed under the FreeBSD copyright for inclusion in the ports area 122in 1999. The program was written by Matthew Dillon and Dima Ruban. 123