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