1 .\" $NetBSD: rdist.1,v 1.18 2004/07/13 12:02:23 wiz Exp $
3 .\" Copyright (c) 1985, 1990, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the University nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" from: @(#)rdist.1 8.3 (Berkeley) 3/17/94
37 .Nd remote file distribution program
49 .Oo login@ Oc Ns Ar host Ns Op :dest
52 is a program to maintain identical copies of files over multiple hosts.
53 It preserves the owner, group, mode, and mtime of files if possible and
54 can update programs that are executing.
58 to direct the updating of files and/or directories.
60 Options specific to the first SYNOPSIS form:
62 .Bl -tag -width indent
68 the standard input is used.
78 option is not specified, the program looks first for
83 If no names are specified on the command line,
85 will update all of the files and directories listed in
87 Otherwise, the argument is taken to be the name of a file to be updated
88 or the label of a command to execute.
89 If label and file names conflict, it is assumed to be a label.
90 These may be used together to update specific files
91 using specific commands.
93 Options specific to the second SYNOPSIS form:
99 to interpret the remaining arguments as a small
102 The equivalent distfile is as follows.
104 .Bd -filled -offset indent -compact
110 .Bd -filled -offset indentindent -compact
116 Options common to both forms:
121 Perform a binary comparison and update files if they differ
122 rather than comparing dates and sizes.
123 .It Fl d Ar var=value
130 option is used to define or override variable definitions in the
133 can be the empty string, one name, or a list of names surrounded by
134 parentheses and separated by tabs and/or spaces.
138 Follow symbolic links.
139 Copy the file that the link points to rather than the
142 Ignore unresolved links.
144 will normally try to maintain the link structure of files being transferred
145 and warn the user if all the links cannot be found.
147 Limit which machines are to be updated.
150 arguments can be given to limit updates to a subset of the hosts listed in the
153 Print the commands without executing them.
159 Files that are being modified are normally
160 printed on standard output.
163 option suppresses this.
165 Remove extraneous files.
166 If a directory is being updated, any files that exist
167 on the remote host that do not exist in the master directory are removed.
168 This is useful for maintaining truly identical copies of directories.
170 Verify that the files are up to date on all the hosts.
172 that are out of date will be displayed but no files will be changed
176 The whole file name is appended to the destination directory
178 Normally, only the last component of a name is used when renaming files.
179 This will preserve the directory structure of the files being
180 copied instead of flattening the directory structure.
182 renaming a list of files such as ( dir1/f1 dir2/f2 ) to dir3 would create
183 files dir3/dir1/f1 and dir3/dir2/f2 instead of dir3/f1 and dir3/f2.
186 Files are normally updated if their
197 not to update files that are younger than the master copy.
199 to prevent newer copies on other hosts from being replaced.
200 A warning message is printed for files which are newer than the master copy.
204 contains a sequence of entries that specify the files
205 to be copied, the destination hosts, and what operations to perform
207 Each entry has one of the following formats.
209 .Bd -literal -offset indent -compact
210 \*[Lt]variable name\*[Gt] `=' \*[Lt]name list\*[Gt]
211 [label:]\*[Lt]source list\*[Gt] `\-\*[Gt]' \*[Lt]destination list\*[Gt] \*[Lt]command list\*[Gt]
212 [label:]\*[Lt]source list\*[Gt] `::' \*[Lt]time_stamp file\*[Gt] \*[Lt]command list\*[Gt]
215 The first format is used for defining variables.
216 The second format is used for distributing files to other hosts.
217 The third format is used for making lists of files that have been changed
218 since some given date.
222 list of files and/or directories on the local host which are to be used
223 as the master copy for distribution.
226 is the list of hosts to which these files are to be
228 Each file in the source list is added to a list of changes
229 if the file is out of date on the host which is being updated (second format) or
230 the file is newer than the time stamp file (third format).
233 They are used to identify a command for partial updates.
235 Newlines, tabs, and blanks are only used as separators and are
237 Comments begin with `#' and end with a newline.
239 Variables to be expanded begin with `$' followed by one character or
240 a name enclosed in curly braces (see the examples at the end).
242 The source and destination lists have the following format:
243 .Bd -literal -offset indent
247 .Bd -literal -offset indent -compact
248 `(' \*[Lt]zero or more names separated by white-space\*[Gt] `)'
251 The shell meta-characters `[', `]', `{', `}', `*', and `?'
252 are recognized and expanded (on the local host only) in the same way as
254 They can be escaped with a backslash.
255 The `~' character is also expanded in the same way as
257 but is expanded separately on the local and destination hosts.
260 option is used with a file name that begins with `~', everything except the
261 home directory is appended to the destination name.
262 File names which do not begin with `/' or `~' use the destination user's
263 home directory as the root directory for the rest of the file name.
265 The command list consists of zero or more commands of the following
267 .Bd -ragged -offset indent -compact
268 .Bl -column except_patx pattern\ listx
269 .It `install' \*[Lt]options\*[Gt] opt_dest_name `;'
270 .It `notify' \*[Lt]name list\*[Gt] `;'
271 .It `except' \*[Lt]name list\*[Gt] `;'
272 .It `except_pat' \*[Lt]pattern list\*[Gt] `;'
273 .It `special' \*[Lt]name list\*[Gt] string `;'
279 command is used to copy out of date files and/or directories.
280 Each source file is copied to each host in the destination list.
281 Directories are recursively copied in the same way.
283 is an optional parameter to rename files.
286 command appears in the command list or
287 the destination name is not specified,
288 the source file name is used.
289 Directories in the path name will be created if they
290 do not exist on the remote host.
291 To help prevent disasters, a non-empty directory on a target host will
292 never be replaced with a regular file or a symbolic link.
293 However, under the `\-R' option a non-empty directory will be removed
294 if the corresponding filename is completely absent on the master host.
297 are `\-R', `\-h', `\-i', `\-v', `\-w', `\-y', and `\-b'
298 and have the same semantics as
299 options on the command line except they only apply to the files
301 The login name used on the destination host is the same as the local host
302 unless the destination name is of the format ``login@host".
306 command is used to mail the list of files updated (and any errors
307 that may have occurred) to the listed names.
308 If no `@' appears in the name, the destination host is appended to
310 (e.g., name1@host, name2@host, ...).
314 command is used to update all of the files in the source list
316 for the files listed in
318 This is usually used to copy everything in a directory except certain files.
326 is a list of regular expressions
330 If one of the patterns matches some string within a file name, that file will
332 Note that since `\e' is a quote character, it must be doubled to become
333 part of the regular expression.
334 Variables are expanded in
336 but not shell file pattern matching characters.
338 must be escaped with `\e'.
342 command is used to specify
344 commands that are to be executed on the
345 remote host after the file in
347 is updated or installed.
350 is omitted then the shell commands will be executed
351 for every file updated or installed.
352 The shell variable `FILE' is set
353 to the current filename before executing the commands in
356 starts and ends with `"' and can cross multiple lines in
358 Multiple commands to the shell should be separated by `;'.
359 Commands are executed in the user's home directory on the host
363 command can be used to rebuild private databases, etc.
364 after a program has been updated.
366 The following is a small example:
367 .Bd -literal -offset indent
368 HOSTS = ( matisse root@arpa )
370 FILES = ( /bin /lib /usr/bin /usr/games
371 \t/usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}
372 \t/usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )
374 EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc
375 \tsendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont )
377 ${FILES} -\*[Gt] ${HOSTS}
379 \texcept /usr/lib/${EXLIB} ;
380 \texcept /usr/games/lib ;
381 \tspecial /usr/lib/sendmail "/usr/lib/sendmail -bz" ;
384 /usr/src/bin -\*[Gt] arpa
385 \texcept_pat ( \e\e.o\e$ /SCCS\e$ ) ;
387 IMAGEN = (ips dviimp catdvi)
390 /usr/local/${IMAGEN} -\*[Gt] arpa
391 \tinstall /usr/local/lib ;
394 ${FILES} :: stamp.cory
398 .Bl -tag -width /tmp/rdist* -compact
402 temporary file for update lists
405 A complaint about mismatch of rdist version numbers may really stem
406 from some problem with starting your shell, e.g., you are in too many groups.
417 Source files must reside on the local host where
421 There is no easy way to have a special command executed after all files
422 in a directory have been updated.
424 Variable expansion only works for name lists; there should be a general macro
428 aborts on files which have a negative mtime (before Jan 1, 1970).
430 There should be a `force' option to allow replacement of non-empty directories
431 by regular files or symlinks.
432 A means of updating file modes and owners
433 of otherwise identical files is also needed.