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