13a42736dSMatthew Dillon.\" (c) Copyright 1997-1999 by Matthew Dillon and Dima Ruban. Permission to 23a42736dSMatthew Dillon.\" use and distribute based on the DragonFly copyright. Supplied as-is, 33a42736dSMatthew Dillon.\" USE WITH EXTREME CAUTION. 43a42736dSMatthew Dillon.\" 53a42736dSMatthew Dillon.\" 6*0dc55843SLiam J. Foy.\" $DragonFly: src/bin/cpdup/cpdup.1,v 1.7 2004/10/31 00:43:14 liamfoy Exp $ 73a42736dSMatthew Dillon.Dd October 28, 1999 83a42736dSMatthew Dillon.Dt CPDUP 1 93a42736dSMatthew Dillon.Os BSD 4 103a42736dSMatthew Dillon.Sh NAME 113a42736dSMatthew Dillon.Nm cpdup 123a42736dSMatthew Dillon.Nd mirror filesystems 133a42736dSMatthew Dillon.Sh SYNOPSIS 143a42736dSMatthew Dillon.Nm cpdup 153a42736dSMatthew Dillon.Op Fl v[vv..] 164d2076d3SChris Pressey.Op Fl u 173a42736dSMatthew Dillon.Op Fl I 183a42736dSMatthew Dillon.Op Fl f 193a42736dSMatthew Dillon.Op Fl s0 203a42736dSMatthew Dillon.Op Fl i0 213a42736dSMatthew Dillon.Op Fl q 223a42736dSMatthew Dillon.Op Fl o 233a42736dSMatthew Dillon.Op Fl m 243a42736dSMatthew Dillon.Oo 253a42736dSMatthew Dillon.Fl M 263a42736dSMatthew Dillon.Ar file 273a42736dSMatthew Dillon.Oc 283a42736dSMatthew Dillon.Oo 29c0d18d1dSMatthew Dillon.Fl X 303a42736dSMatthew Dillon.Ar file 313a42736dSMatthew Dillon.Oc 32c0d18d1dSMatthew Dillon.Op Fl x 333a42736dSMatthew Dillon.Ar source_dir 343a42736dSMatthew Dillon.Ar target_dir 353a42736dSMatthew Dillon.Sh DESCRIPTION 363a42736dSMatthew DillonThe 373a42736dSMatthew Dillon.Nm 383a42736dSMatthew Dillonutility makes an exact mirror copy of the source in the destination, creating 393a42736dSMatthew Dillonand deleting files and directories as necessary. UTimes, hardlinks, 403a42736dSMatthew Dillonsoftlinks, devices, permissions, and flags are mirrored. By default, 413a42736dSMatthew Dillon.Nm 423a42736dSMatthew Dillonasks for confirmation if any file or directory needs to be removed from 433a42736dSMatthew Dillonthe destination and does not copy files which it believes to have already 443a42736dSMatthew Dillonbeen synchronized (by observing that the source and destination file's size 453a42736dSMatthew Dillonand mtimes match). 463a42736dSMatthew Dillon.Nm 4773afa964SChris Presseydoes not cross mount points in either the source or the destination. 4873afa964SChris PresseyAs a safety measure, 493a42736dSMatthew Dillon.Nm 503a42736dSMatthew Dillonrefuses to replace a destination directory with a file. 513a42736dSMatthew Dillon.Pp 523a42736dSMatthew DillonThe following options are available: 533a42736dSMatthew Dillon.Bl -tag -width flag 54*0dc55843SLiam J. Foy.It Fl v[vv] 553a42736dSMatthew DillonSet verboseness. By default 563a42736dSMatthew Dillon.Nm 573a42736dSMatthew Dillondoes not report its progress except when asking for confirmation. A single 583a42736dSMatthew Dillon.Fl v 593a42736dSMatthew Dillonwill only report modifications made to the destination. 603a42736dSMatthew Dillon.Fl vv 613a42736dSMatthew Dillonwill report directories as they are being traversed as well as 623a42736dSMatthew Dillonmodifications made to the destination. 633a42736dSMatthew Dillon.Fl vvv 643a42736dSMatthew Dillonwill cause all files and directories to be reported whether or not 653a42736dSMatthew Dillonmodifications are made. 664d2076d3SChris Pressey.It Fl u 674d2076d3SChris PresseyCauses the ouptut generated by 684d2076d3SChris Pressey.Fl v[vv] 694d2076d3SChris Presseyto be unbuffered. 704d2076d3SChris PresseyThis can be useful for obtaining prompt progress updates through a pipe. 713a42736dSMatthew Dillon.It Fl I 723a42736dSMatthew Dillonwill cause cpdup to print a summary at the end with performance counter. 733a42736dSMatthew Dillon.It Fl f 743a42736dSMatthew DillonForces file updates to occur even if the files appear to be the same. 753a42736dSMatthew Dillon.It Fl s0 763a42736dSMatthew DillonDisable the disallow-file-replaces-directory safety feature. This 773a42736dSMatthew Dillonsafety feature is enabled by default to prevent user mistakes from blowing 783a42736dSMatthew Dillonaway everything accidently. 793a42736dSMatthew Dillon.It Fl i0 803a42736dSMatthew DillonDo not request confirmation when removing something. 813a42736dSMatthew Dillon.It Fl q 823a42736dSMatthew DillonQuiet operation 833a42736dSMatthew Dillon.It Fl o 843a42736dSMatthew DillonDo not remove any files, just overwrite/add. 853a42736dSMatthew Dillon.It Fl m 863a42736dSMatthew DillonGenerate and maintain an MD5 checkfile in each directory on the source 873a42736dSMatthew Dillonand do an MD5 check on each file of the destination when the destination 883a42736dSMatthew Dillonappears to be the same as the source. If the check fails, 893a42736dSMatthew Dillon.Nm 903a42736dSMatthew Dillonthe source is recopied to the destination. When you specify a destination 913a42736dSMatthew Dillondirectory the MD5 checkfile is only updated as needed and may not be updated 923a42736dSMatthew Dilloneven if modifications are made to a source file. If you do not specify a 933a42736dSMatthew Dillondestination directory the 943a42736dSMatthew Dillon.Nm 953a42736dSMatthew Dilloncommand forcefully regenerates the MD5 checkfile for every file in the source. 963a42736dSMatthew Dillon.It Fl M 973a42736dSMatthew DillonWorks the same as 983a42736dSMatthew Dillon.Fl m 993a42736dSMatthew Dillonbut allows you to specify the name of the MD5 checkfile. 1003a42736dSMatthew Dillon.It Fl x 1013a42736dSMatthew DillonCauses 1023a42736dSMatthew Dillon.Nm 1033a42736dSMatthew Dillonto use the exclusion file ".cpignore" in each directory on the source to 1043a42736dSMatthew Dillondetermine which files to ignore. When this option is used, the exclusion 1053a42736dSMatthew Dillonfilename itself is automatically excluded from the copy. If this option is 1063a42736dSMatthew Dillonnot used then the filename ".cpignore" is not considered special and will 1073a42736dSMatthew Dillonbe copied along with everything else. 1083a42736dSMatthew Dillon.It Fl X 1093a42736dSMatthew DillonWorks the same as 1103a42736dSMatthew Dillon.Fl x 1113a42736dSMatthew Dillonbut allows you to specify the name of the exclusion file. This file is 1123a42736dSMatthew Dillonautomatically excluded from the copy. Only one exclusion file may be 1133a42736dSMatthew Dillonspecified. 11452ac7bd7SHiten Pandya.El 1153a42736dSMatthew Dillon.Sh DIAGNOSTICS 1163a42736dSMatthew DillonThe 1173a42736dSMatthew Dillon.Nm 1183a42736dSMatthew Dillonutility exits 0 if no modifications were made, and >0 if modifications 1193a42736dSMatthew Dillonwere made to the destination. 1203a42736dSMatthew Dillon.Sh SEE ALSO 1213a42736dSMatthew Dillon.Xr cp 1 , 1223a42736dSMatthew Dillon.Xr cpio 1 , 1232653401fSChris Pressey.Xr tar 1 1243a42736dSMatthew Dillon.Sh HISTORY 1253a42736dSMatthew DillonThe 1263a42736dSMatthew Dillon.Nm 1273a42736dSMatthew Dilloncommand was original created to update servers at BEST Internet circa 1997 1283a42736dSMatthew Dillonand was placed under the FreeBSD copyright for inclusion in the ports area 1293a42736dSMatthew Dillonin 1999. The program was written by Matthew Dillon and Dima Ruban. 130