Commit | Line | Data |
---|---|---|
1c4ad2f3 KB |
1 | .\" Copyright (c) 1985 The Regents of the University of California. |
2 | .\" All rights reserved. | |
6be9699a | 3 | .\" |
1c4ad2f3 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
15 | .\" | |
e3419641 | 16 | .\" @(#)rdist.1 6.7 (Berkeley) 9/20/88 |
6be9699a | 17 | .\" |
e3419641 | 18 | .TH RDIST 1 "September 20, 1988" |
6be9699a KM |
19 | .UC 6 |
20 | .ad | |
21 | .SH NAME | |
22 | rdist \- remote file distribution program | |
23 | .SH SYNOPSIS | |
24 | .B rdist | |
25 | [ \-nqbRhivwy ] | |
26 | [ \-f distfile ] [ \-d var=value ] [ \-m host ] | |
27 | [ name ... ] | |
28 | .PP | |
29 | .B rdist | |
30 | [ \-nqbRhivwy ] -c name ... [login@]host[:dest] | |
31 | .SH DESCRIPTION | |
32 | .I Rdist | |
33 | is a program to maintain identical copies of files over multiple hosts. | |
34 | It preserves the owner, group, mode, and mtime of files if possible and | |
35 | can update programs that are executing. | |
36 | .I Rdist | |
37 | reads commands from | |
38 | .I distfile | |
39 | to direct the updating of files and/or directories. | |
40 | If | |
41 | .I distfile | |
42 | is `\-', the standard input is used. | |
43 | If no | |
44 | .B \-f | |
e0652b60 JB |
45 | option is present, the program looks first for `distfile', |
46 | then `Distfile' to use as the input. | |
6be9699a KM |
47 | If no names are specified on the command line, |
48 | .I rdist | |
49 | will update all of the files and directories listed in | |
50 | .IR distfile . | |
51 | Otherwise, the argument is taken to be the name of a file to be updated | |
52 | or the label of a command to execute. If label and file names conflict, | |
53 | it is assumed to be a label. | |
54 | These may be used together to update specific files | |
55 | using specific commands. | |
56 | .PP | |
57 | The | |
58 | .B \-c | |
59 | option forces | |
60 | .I rdist | |
61 | to interpret the remaining arguments as a small | |
62 | .IR distfile . | |
63 | The equivalent distfile is as follows. | |
64 | .nf | |
65 | ||
66 | .ti +.5i | |
67 | ( \fIname\fP ... ) -> [\fIlogin\fP@]\fIhost\fP | |
68 | .ti +1i | |
69 | install [\fIdest\fP] ; | |
70 | ||
71 | .fi | |
72 | .PP | |
73 | Other options: | |
74 | .TP | |
75 | .B \-d | |
76 | Define | |
77 | .I var | |
78 | to have | |
79 | .IR value . | |
80 | The | |
81 | .B \-d | |
82 | option is used to define or override variable definitions in the | |
83 | .IR distfile . | |
84 | .I Value | |
85 | can be the empty string, one name, or a list of names surrounded by | |
86 | parentheses and separated by tabs and/or spaces. | |
87 | .TP | |
88 | .B \-m | |
89 | Limit which machines are to be updated. Multiple | |
90 | .B -m | |
91 | arguments can be given to limit updates to a subset of the hosts listed the | |
92 | .IR distfile . | |
93 | .TP | |
94 | .B \-n | |
95 | Print the commands without executing them. This option is | |
96 | useful for debugging | |
97 | .IR distfile . | |
98 | .TP | |
99 | .B \-q | |
100 | Quiet mode. Files that are being modified are normally | |
101 | printed on standard output. The | |
102 | .B \-q | |
103 | option suppresses this. | |
104 | .TP | |
105 | .B \-R | |
106 | Remove extraneous files. If a directory is being updated, any files that exist | |
107 | on the remote host that do not exist in the master directory are removed. | |
108 | This is useful for maintaining truely identical copies of directories. | |
109 | .TP | |
110 | .B \-h | |
111 | Follow symbolic links. Copy the file that the link points to rather than the | |
112 | link itself. | |
113 | .TP | |
114 | .B \-i | |
115 | Ignore unresolved links. | |
116 | .I Rdist | |
117 | will normally try to maintain the link structure of files being transfered | |
118 | and warn the user if all the links cannot be found. | |
119 | .TP | |
120 | .B \-v | |
121 | Verify that the files are up to date on all the hosts. Any files | |
122 | that are out of date will be displayed but no files will be changed | |
123 | nor any mail sent. | |
124 | .TP | |
125 | .B \-w | |
126 | Whole mode. The whole file name is appended to the destination directory | |
127 | name. Normally, only the last component of a name is used when renaming files. | |
128 | This will preserve the directory structure of the files being | |
129 | copied instead of flattening the directory structure. For example, | |
130 | renaming a list of files such as ( dir1/f1 dir2/f2 ) to dir3 would create | |
131 | files dir3/dir1/f1 and dir3/dir2/f2 instead of dir3/f1 and dir3/f2. | |
132 | .TP | |
133 | .B \-y | |
134 | Younger mode. Files are normally updated if their | |
135 | .I mtime | |
136 | and | |
137 | .I size | |
138 | (see | |
139 | .IR stat (2)) | |
140 | disagree. The | |
141 | .B \-y | |
142 | option causes | |
143 | .I rdist | |
144 | not to update files that are younger than the master copy. | |
145 | This can be used | |
146 | to prevent newer copies on other hosts from being replaced. | |
147 | A warning message is printed for files which are newer than the master copy. | |
148 | .TP | |
149 | .B \-b | |
150 | Binary comparison. Perform a binary comparison and update files if they differ | |
151 | rather than comparing dates and sizes. | |
152 | .PP | |
153 | .I Distfile | |
154 | contains a sequence of entries that specify the files | |
155 | to be copied, the destination hosts, and what operations to perform | |
156 | to do the updating. Each entry has one of the following formats. | |
157 | .nf | |
158 | ||
159 | .in +.5i | |
160 | <variable name> `=' <name list> | |
161 | [ label: ] <source list> `\->' <destination list> <command list> | |
162 | [ label: ] <source list> `::' <time_stamp file> <command list> | |
163 | .in | |
164 | ||
165 | .fi | |
166 | The first format is used for defining variables. | |
167 | The second format is used for distributing files to other hosts. | |
168 | The third format is used for making lists of files that have been changed | |
169 | since some given date. | |
170 | The \fIsource list\fP specifies a | |
171 | list of files and/or directories on the local host which are to be used | |
172 | as the master copy for distribution. | |
c33a908d | 173 | The \fIdestination list\fP is the list of hosts to which these files are to be |
78261a91 | 174 | copied. Each file in the source list is added to a list of changes |
c33a908d | 175 | if the file is out of date on the host which is being updated (second format) or |
6be9699a KM |
176 | the file is newer than the time stamp file (third format). |
177 | .PP | |
178 | Labels are optional. They are used to identify a command for partial updates. | |
179 | .PP | |
180 | Newlines, tabs, and blanks are only used as separators and are | |
181 | otherwise ignored. Comments begin with `#' and end with a newline. | |
182 | .PP | |
183 | Variables to be expanded begin with `$' followed by one character or | |
184 | a name enclosed in curly braces (see the examples at the end). | |
185 | .PP | |
186 | The source and destination lists have the following format: | |
187 | .nf | |
188 | ||
189 | .ti +.5i | |
190 | <name> | |
191 | or | |
192 | .ti +.5i | |
193 | `(' <zero or more names separated by white-space> `)' | |
194 | ||
195 | .fi | |
196 | The shell meta-characters `[', `]', `{', `}', `*', and `?' | |
197 | are recognized and expanded (on the local host only) in the same way as | |
198 | .IR csh (1). | |
199 | They can be escaped with a backslash. | |
200 | The `~' character is also expanded in the same way as | |
201 | .IR csh | |
202 | but is expanded separately on the local and destination hosts. | |
203 | When the | |
204 | .B \-w | |
205 | option is used with a file name that begins with `~', everything except the | |
206 | home directory is appended to the destination name. | |
207 | File names which do not begin with `/' or `~' use the destination user's | |
208 | home directory as the root directory for the rest of the file name. | |
209 | .PP | |
210 | The command list consists of zero or more commands of the following | |
211 | format. | |
212 | .nf | |
213 | ||
214 | .in +.5i | |
215 | .ta \w'install 'u +\w'name list 'u | |
216 | `install' <options> opt_dest_name `;' | |
217 | `notify' <name list> `;' | |
218 | `except' <name list> `;' | |
219 | `except_pat' <pattern list> `;' | |
220 | `special' <name list> string `;' | |
221 | .in | |
222 | ||
223 | .fi | |
224 | .PP | |
225 | The | |
226 | .I install | |
227 | command is used to copy out of date files and/or directories. | |
228 | Each source file is copied to each host in the destination list. | |
229 | Directories are recursively copied in the same way. | |
230 | .I Opt_dest_name | |
231 | is an optional parameter to rename files. | |
232 | If no | |
233 | .I install | |
234 | command appears in the command list or | |
235 | the destination name is not specified, | |
236 | the source file name is used. | |
237 | Directories in the path name will be created if they | |
238 | do not exist on the remote host. | |
a026e4fc JL |
239 | To help prevent disasters, a non-empty directory on a target host will |
240 | never be replaced with a regular file or a symbolic link. | |
241 | However, under the `\-R' option a non-empty directory will be removed | |
242 | if the corresponding filename is completely absent on the master host. | |
6be9699a KM |
243 | The |
244 | .I options | |
245 | are `\-R', `\-h', `\-i', `\-v', `\-w', `\-y', and `\-b' | |
246 | and have the same semantics as | |
247 | options on the command line except they only apply to the files | |
248 | in the source list. | |
249 | The login name used on the destination host is the same as the local host | |
250 | unless the destination name is of the format ``login@host". | |
251 | .PP | |
252 | The | |
253 | .I notify | |
254 | command is used to mail the list of files updated (and any errors | |
255 | that may have occured) to the listed names. | |
256 | If no `@' appears in the name, the destination host is appended to | |
257 | the name | |
258 | (e.g., name1@host, name2@host, ...). | |
259 | .PP | |
260 | The | |
261 | .I except | |
262 | command is used to update all of the files in the source list | |
263 | .B except | |
264 | for the files listed in \fIname list\fP. | |
a026e4fc | 265 | This is usually used to copy everything in a directory except certain files. |
6be9699a KM |
266 | .PP |
267 | The | |
268 | .I except_pat | |
269 | command is like the | |
270 | .I except | |
271 | command except that \fIpattern list\fP is a list of regular expressions | |
272 | (see | |
273 | .IR ed (1) | |
274 | for details). | |
275 | If one of the patterns matches some string within a file name, that file will | |
276 | be ignored. | |
a026e4fc JL |
277 | Note that since `\e' is a quote character, it must be doubled to become |
278 | part of the regular expression. Variables are expanded in \fIpattern list\fP | |
279 | but not shell file pattern matching characters. To include a `$', it | |
280 | must be escaped with `\e'. | |
6be9699a KM |
281 | .PP |
282 | The | |
283 | .I special | |
284 | command is used to specify | |
285 | .IR sh (1) | |
286 | commands that are to be executed on the | |
287 | remote host after the file in \fIname list\fP is updated or installed. | |
288 | If the \fIname list\fP is omitted then the shell commands will be executed | |
289 | for every file updated or installed. The shell variable `FILE' is set | |
290 | to the current filename before executing the commands in | |
291 | .IR string . | |
292 | .I String | |
293 | starts and ends with `"' and can cross multiple lines in | |
294 | .I distfile. | |
295 | Multiple commands to the shell should be separated by `;'. | |
296 | Commands are executed in the user's home directory on the host | |
297 | being updated. | |
298 | The | |
299 | .I special | |
300 | command can be used to rebuild private databases, etc. | |
301 | after a program has been updated. | |
302 | .PP | |
303 | The following is a small example. | |
304 | .nf | |
305 | ||
306 | .in +.5i | |
a2a3f014 | 307 | HOSTS = ( matisse root@arpa) |
6be9699a KM |
308 | |
309 | FILES = ( /bin /lib /usr/bin /usr/games | |
310 | /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h} | |
311 | /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist ) | |
312 | ||
313 | EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc | |
314 | sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont ) | |
315 | ||
316 | ${FILES} -> ${HOSTS} | |
317 | install -R ; | |
318 | except /usr/lib/${EXLIB} ; | |
319 | except /usr/games/lib ; | |
320 | special /usr/lib/sendmail "/usr/lib/sendmail -bz" ; | |
321 | ||
322 | srcs: | |
323 | /usr/src/bin -> arpa | |
a026e4fc | 324 | except_pat ( \e\e.o\e$ /SCCS\e$ ) ; |
6be9699a KM |
325 | |
326 | IMAGEN = (ips dviimp catdvi) | |
327 | ||
328 | imagen: | |
329 | /usr/local/${IMAGEN} -> arpa | |
330 | install /usr/local/lib ; | |
331 | notify ralph ; | |
332 | ||
333 | ${FILES} :: stamp.cory | |
334 | notify root@cory ; | |
335 | .in | |
336 | ||
337 | .fi | |
338 | .SH FILES | |
339 | .nf | |
340 | .ta \w'/tmp/rdist* 'u | |
341 | distfile input command file | |
342 | /tmp/rdist* temporary file for update lists | |
343 | .fi | |
344 | .SH "SEE ALSO" | |
345 | sh(1), csh(1), stat(2) | |
a026e4fc JL |
346 | .SH DIAGNOSTICS |
347 | A complaint about mismatch of rdist version numbers may really stem | |
348 | from some problem with starting your shell, e.g., you are in too many groups. | |
6be9699a KM |
349 | .SH BUGS |
350 | Source files must reside on the local host where rdist is executed. | |
351 | .PP | |
352 | There is no easy way to have a special command executed after all files | |
353 | in a directory have been updated. | |
354 | .PP | |
a026e4fc | 355 | Variable expansion only works for name lists; there should be a general macro |
6be9699a | 356 | facility. |
a026e4fc JL |
357 | .PP |
358 | .I Rdist | |
359 | aborts on files which have a negative mtime (before Jan 1, 1970). | |
360 | .PP | |
361 | There should be a `force' option to allow replacement of non-empty directories | |
362 | by regular files or symlinks. A means of updating file modes and owners | |
363 | of otherwise identical files is also needed. |