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