Annotation of src/usr.bin/rdist/rdist.1, Revision 1.12
1.12 ! aaron 1: .\" $OpenBSD: rdist.1,v 1.11 2000/03/11 21:40:07 aaron Exp $
1.2 dm 2: .\"
3: .\" Copyright (c) 1983 Regents of the University of California.
4: .\" All rights reserved.
1.1 deraadt 5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
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. All advertising materials mentioning features or use of this software
15: .\" must display the following acknowledgement:
16: .\" This product includes software developed by the University of
17: .\" California, Berkeley and its contributors.
18: .\" 4. Neither the name of the University nor the names of its contributors
19: .\" may be used to endorse or promote products derived from this software
20: .\" without specific prior written permission.
21: .\"
22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: .\" SUCH DAMAGE.
33: .\"
1.6 millert 34: .\" $From: rdist.man,v 6.34 1996/01/29 22:37:19 mcooper Exp $
1.2 dm 35: .\" @(#)rdist.1 6.6 (Berkeley) 5/13/86
1.1 deraadt 36: .\"
1.3 dm 37: .TH RDIST 1 "January 29, 1996"
1.2 dm 38: .UC 6
39: .SH NAME
40: rdist \- remote file distribution client program
41: .SH SYNOPSIS
42: .B rdist
1.8 aaron 43: [
1.2 dm 44: .B \-DFn
45: ]
1.8 aaron 46: [
47: .B \-A
48: .I num
49: ]
50: [
51: .B \-a
1.2 dm 52: .I num
1.8 aaron 53: ]
54: [
55: .B \-d
56: .I var=value
57: ]
58: [
1.2 dm 59: .B \-l
60: .I <local logopts>
1.8 aaron 61: ]
62: [
1.2 dm 63: .B \-L
64: .I <remote logopts>
1.8 aaron 65: ]
66: [
67: .B \-f
68: .I distfile
69: ]
70: [
71: .B \-M
1.2 dm 72: .I maxproc
73: ]
1.8 aaron 74: [
75: .B \-m
76: .I host
77: ]
78: [
1.2 dm 79: .B \-o
80: .I distopts
81: ]
1.8 aaron 82: [
83: .B \-t
84: .I timeout
85: ]
1.2 dm 86: [
87: .B \-p
88: .I <rdistd-path>
89: ]
90: [
91: .B \-P
92: .I <rsh-path>
93: ]
1.8 aaron 94: [
1.2 dm 95: .I name ...
96: ]
97: .PP
98: .B rdist
99: .B \-DFn
1.8 aaron 100: .B -c
101: .I name ...
1.2 dm 102: .I [login@]host[:dest]
103: .PP
104: .B rdist
105: .B \-Server
106: .PP
107: .B rdist
108: .B \-V
109: .SH DESCRIPTION
110: .I Rdist
1.8 aaron 111: is a program to maintain identical copies of files over multiple hosts.
1.1 deraadt 112: It preserves the owner, group, mode, and mtime of files if possible and
113: can update programs that are executing.
1.2 dm 114: .I Rdist
1.1 deraadt 115: reads commands from
1.2 dm 116: .I distfile
1.1 deraadt 117: to direct the updating of files and/or directories.
118: If
1.2 dm 119: .I distfile
120: is `\-', the standard input is used.
121: If no
122: .B \-f
123: option is present, the program looks first for `distfile',
124: then `Distfile' to use as the input.
1.1 deraadt 125: If no names are specified on the command line,
1.2 dm 126: .I rdist
1.1 deraadt 127: will update all of the files and directories listed in
1.2 dm 128: .IR distfile .
1.1 deraadt 129: Otherwise, the argument is taken to be the name of a file to be updated
130: or the label of a command to execute. If label and file names conflict,
131: it is assumed to be a label.
132: These may be used together to update specific files
133: using specific commands.
1.2 dm 134: .PP
135: The
136: .B \-c
137: option forces
138: .I rdist
1.1 deraadt 139: to interpret the remaining arguments as a small
1.2 dm 140: .IR distfile .
1.1 deraadt 141: The equivalent distfile is as follows.
1.2 dm 142: .nf
143:
144: .ti +.5i
145: ( \fIname\fP ... ) -> [\fIlogin\fP@]\fIhost\fP
146: .ti +1i
147: install [\fIdest\fP] ;
148:
149: .fi
150: .PP
151: The
152: .B \-Server
153: option is recognized to provide partial backward compatible support
154: for older versions of
155: .I rdist
156: which used this option to put
157: .I rdist
158: into server mode.
159: If
160: .I rdist
1.8 aaron 161: is started with the
1.2 dm 162: .B \-Server
163: command line option, it will attempt to exec (run) the old version of
164: .I rdist.
1.8 aaron 165: This option will only work if
1.2 dm 166: .I rdist
167: was compiled with the location of the old rdist
168: (usually either
169: .I /usr/ucb/oldrdist
170: or
171: .I /usr/old/rdist)
172: and that program is available at run time.
173: .PP
174: .I Rdist
175: can use either the
176: .I rcmd(3)
1.8 aaron 177: function call or the
1.2 dm 178: .I rsh(1c),
179: remote shell, command to access each target host.
180: The method used is selected at compile-time.
181: If the
182: .I rsh(1c)
183: method is used and
184: the target host is the string
185: .B localhost
1.8 aaron 186: and
1.2 dm 187: the remote user name is the same as the local user name,
188: .I rdist
189: will run the command
190: .nf
191: .sp
192: .RS
193: .B "/bin/sh -c rdistd -S"
194: .RE
195: .sp
196: .fi
197: Otherwise
198: .I rdist
199: run will run the command
200: .nf
201: .sp
202: .RS
203: \fBrsh \fIhost\fB -l \fIremuser \fBrdistd -S\fR
204: .RE
205: .sp
206: .fi
1.8 aaron 207: where
1.2 dm 208: .I host
209: is the name of the target host,
210: .I remuser
211: is the name of the user to make the connection as and,
212: .I rdistd
213: is the rdist server command on the target host as shown below.
214: .PP
215: If the
1.8 aaron 216: .I rcmd(3)
1.2 dm 217: method is used, then
218: .I rdist
219: makes the connection to the target host itself and runs
1.8 aaron 220: the
1.2 dm 221: .I rdistd
222: server program as shown below.
223: The default, and preferred method, is to use
224: .I rsh(1c)
1.8 aaron 225: to make the connection to target hosts. This allows
1.2 dm 226: .I rdist
227: to be run without being setuid to ``root''.
228: .PP
229: On each target host
230: .I Rdist
231: will attempt to run the command
232: .nf
233: .sp
234: .RS
235: .I "rdistd -S"
236: .RE
237: .sp
238: .fi
239: or
240: .nf
241: .sp
242: .RS
243: .I "<rdistd path> -S"
244: .RE
245: .sp
246: .fi
247: if the
248: .I \-p
249: option was specified.
250: If no
1.8 aaron 251: .B \-p
1.2 dm 252: option is included,
253: or the
254: .I <rdistd path>
255: is a simple filename,
256: .I rdistd
257: or
258: .I <rdistd path>
1.8 aaron 259: must be somewhere in the
1.2 dm 260: .B $PATH
261: of the user running
262: .B rdist
263: on the remote (target) host.
264: .SH OPTIONS
265: .TP
266: .B "\-A \fInum\fR"
267: Set the minimum number of free files (inodes) on a filesystem that must exist
1.8 aaron 268: for
1.2 dm 269: .I rdist
270: to update or install a file.
271: .TP
272: .B "\-a \fInum\fR"
273: Set the minimum amount of free space (in bytes) on a filesystem that must exist
1.8 aaron 274: for
1.2 dm 275: .I rdist
276: to update or install a file.
277: .TP
278: .B \-D
279: Enable copious debugging messages.
280: .TP
281: .B "\-d \fIvar=value\fR"
1.1 deraadt 282: Define
1.2 dm 283: .I var
1.1 deraadt 284: to have
1.2 dm 285: .IR value .
286: This
1.1 deraadt 287: option is used to define or override variable definitions in the
1.2 dm 288: .IR distfile .
289: .I Value
1.1 deraadt 290: can be the empty string, one name, or a list of names surrounded by
291: parentheses and separated by tabs and/or spaces.
1.2 dm 292: .TP
293: .B \-F
1.8 aaron 294: Do not fork any child
1.2 dm 295: .I rdist
296: processes.
297: All clients are updated sequentially.
298: .TP
299: .B "\-f \fIdistfile\fR"
300: Set the name of the distfile to use to be
301: .I distfile .
1.8 aaron 302: If
1.2 dm 303: .I distfile
304: is specified as
305: ``\-'' (dash)
306: then read from standard input (stdin).
307: .TP
308: .B "\-l \fIlogopts\fR"
309: Set local logging options.
1.8 aaron 310: See the section
1.2 dm 311: .B "MESSAGE LOGGING"
312: for details on the syntax for
313: .I logopts.
314: .TP
315: .B "\-L \fIlogopts\fR"
316: Set remote logging options.
317: .I logopts
318: is the same as for local logging
319: except the values are passed to the remote
320: server (\fIrdistd\fR).
1.8 aaron 321: See the section
1.2 dm 322: .B "MESSAGE LOGGING"
323: for details on the syntax for
324: .I logopts.
325: .TP
326: .B "\-M \fInum\fR"
327: Set the maximum number of simultaneously
328: running child
329: .I rdist
330: processes to
331: .I num.
332: The default is 4.
333: .TP
334: .B "\-m \fImachine\fR"
1.1 deraadt 335: Limit which machines are to be updated. Multiple
1.2 dm 336: .B \-m
1.1 deraadt 337: arguments can be given to limit updates to a subset of the hosts listed in the
1.2 dm 338: .IR distfile .
339: .TP
340: .B \-n
1.1 deraadt 341: Print the commands without executing them. This option is
342: useful for debugging
1.2 dm 343: .IR distfile .
344: .TP
345: .B "\-o\fIdistopts\fR"
346: Specify the dist options to enable.
347: .I distopts
348: is a comma separated list of options which are listed below.
349: The valid values for
350: .I distopts
351: are:
352: .RS
353: .IP \fBverify\fR
1.1 deraadt 354: Verify that the files are up to date on all the hosts. Any files
355: that are out of date will be displayed but no files will be changed
356: nor any mail sent.
1.2 dm 357: .IP \fBwhole\fR
1.1 deraadt 358: Whole mode. The whole file name is appended to the destination directory
1.2 dm 359: name. Normally, only the last component of a name is used when renaming files.
1.1 deraadt 360: This will preserve the directory structure of the files being
361: copied instead of flattening the directory structure. For example,
1.2 dm 362: rdisting a list of files such as
1.8 aaron 363: .I /path/dir1/f1
1.2 dm 364: and
1.8 aaron 365: .I /path/dir2/f2
366: to
367: .I /tmp/dir
1.2 dm 368: would create
1.8 aaron 369: files
370: .I /tmp/dir/path/dir1/f1
371: and
372: .I /tmp/dir/path/dir2/f2
373: instead of
374: .I /tmp/dir/dir1/f1
375: and
1.2 dm 376: .I /tmp/dir/dir2/f2.
377: .IP \fBnoexec\fR
1.8 aaron 378: Automatically exclude executable files that are in
1.2 dm 379: .I a.out(5)
1.8 aaron 380: format from being checked or updated.
1.2 dm 381: .IP \fByounger\fR
1.1 deraadt 382: Younger mode. Files are normally updated if their
1.2 dm 383: .I mtime
1.1 deraadt 384: and
1.2 dm 385: .I size
1.1 deraadt 386: (see
1.2 dm 387: .IR stat (2))
388: disagree. This
1.1 deraadt 389: option causes
1.2 dm 390: .I rdist
1.1 deraadt 391: not to update files that are younger than the master copy.
392: This can be used
393: to prevent newer copies on other hosts from being replaced.
394: A warning message is printed for files which are newer than the master copy.
1.2 dm 395: .IP \fBcompare\fR
396: Binary comparison. Perform a binary comparison and update files if they differ
397: rather than comparing dates and sizes.
398: .IP \fBfollow\fR
399: Follow symbolic links. Copy the file that the link points to rather than the
400: link itself.
401: .IP \fBignlnks\fR
402: Ignore unresolved links.
403: .I Rdist
404: will normally try to maintain the link structure of files being transferred
405: and warn the user if all the links cannot be found.
406: .IP \fBchknfs\fR
407: Do not check or update files on target host that
408: reside on NFS filesystems.
409: .IP \fBchkreadonly\fR
410: Enable check on target host
411: to see if a file resides on a read-only filesystem.
412: If a file does, then no checking or updating of the file is attempted.
413: .IP \fBchksym\fR
414: If the target on the remote host is a symbolic link, but is not on the
415: master host, the remote target will be left a symbolic link.
416: This behavior is generally considered a bug in the original version of
417: .I rdist,
418: but is present to allow compatibility with older versions.
419: .IP \fBquiet\fR
420: Quiet mode. Files that are being modified are normally
421: printed on standard output. This
422: option suppresses this.
423: .IP \fBremove\fR
424: Remove extraneous files. If a directory is being updated, any files that exist
425: on the remote host that do not exist in the master directory are removed.
426: This is useful for maintaining truly identical copies of directories.
427: .IP \fBnochkowner\fR
428: Do not check user ownership of files that already exist.
429: The file ownership is only set when the file is updated.
430: .IP \fBnochkgroup\fR
431: Do not check group ownership of files that already exist.
432: The file ownership is only set when the file is updated.
433: .IP \fBnochkmode\fR
434: Do not check file and directory permission modes.
435: The permission mode is only set when the file is updated.
436: .IP \fBnodescend\fR
437: Do not descend into a directory.
1.8 aaron 438: Normally
1.2 dm 439: .I rdist
440: will recursively check directories.
441: If this option is enabled, then any files listed in the
442: file list in the distfile that are directories are not recursively scanned.
443: Only the existence, ownership, and mode of the directory are checked.
444: .IP \fBnumchkgroup\fR
1.9 aaron 445: Use the numeric group ID (GID) to check group ownership instead of
1.2 dm 446: the group name.
447: .IP \fBnumchkowner\fR
1.9 aaron 448: Use the numeric user ID (UID) to check user ownership instead of
1.2 dm 449: the user name.
450: .IP \fBsavetargets\fR
451: Save files that are updated instead of removing them.
452: Any target file that is updates is first rename from
453: .B file
454: to
455: .B file.OLD.
1.3 dm 456: .IP \fBsparse\fR
457: Enable checking for sparse (aka \fIwholely\fR) files. One of the most
458: common types of sparse files are those produced by
459: .B ndbm(3).
460: This option adds some additional processing overhead so it should
461: only be enabled for targets likely to contain sparse files.
1.2 dm 462: .RE
463: .TP
464: .B "\-p \fI<rdistd-path>\fR"
465: Set the path where the rdistd server is searched for on the target host.
466: .TP
467: .B "\-P \fI<rsh-path>\fR"
1.8 aaron 468: Set the path to the
1.2 dm 469: .I rsh(1c)
470: command.
471: The
472: .I rsh-path
1.7 deraadt 473: may be a colon separated list of possible pathnames.
1.2 dm 474: In this case, the first component of the path to exist is used.
1.11 aaron 475: i.e.,
1.2 dm 476: .B "/usr/ucb/rsh:/usr/bin/remsh",
477: .B /usr/bsd/rsh.
478: .TP
479: .B "\-t \fItimeout\fR"
1.8 aaron 480: Set the timeout period (in seconds) for waiting for responses from the remote
1.2 dm 481: .I rdist
482: server.
483: The default is 900 seconds.
484: .TP
485: .B \-V
486: Print version information and exit.
487: .SH "MESSAGE LOGGING"
488: .I Rdist
489: uses a collection of predefined message
490: .B facilities
491: that each contain a list of message
492: .B types
1.8 aaron 493: specifying which types of messages to send to that
1.2 dm 494: .I facility.
495: The local client (\fIrdist\fR) and the remote server (\fIrdistd\fR) each
496: maintain
497: their own copy of what types of messages to log to what facilities.
498: .LP
1.8 aaron 499: The
1.2 dm 500: .B \-l
501: .I logopts
502: option to
503: .I rdist
504: tells
505: .I rdist
506: what logging options to use locally.
1.8 aaron 507: The
1.2 dm 508: .B \-L
509: .I logopts
510: option to
511: .I rdist
512: tells
513: .I rdist
514: what logging options to pass to the remote
515: .I rdistd
516: server.
517: .LP
518: The form of
519: .I logopts
520: should be of form
521: .sp
522: .RS
523: \fIfacility\fB=\fItypes\fB:\fIfacility\fB=\fItypes...
524: .RE
525: .sp
526: The valid facility names are:
527: .RS
528: .IP \fBstdout\fR
529: Messages to standard output.
530: .IP \fBfile\fR
1.8 aaron 531: Log to a file. To specify the file name, use the format
1.2 dm 532: ``\fBfile=\fIfilename\fB=\fItypes\fR''.
1.12 ! aaron 533: e.g.,
1.2 dm 534: .B "``file=/tmp/rdist.log=all,debug''.
535: .IP \fBsyslog\fR
1.8 aaron 536: Use the
1.2 dm 537: .I syslogd(8)
538: facility.
539: .IP \fBnotify\fR
540: Use the internal
541: .I rdist
542: .B notify
543: facility.
544: This facility is used in conjunction with the
545: .B notify
1.8 aaron 546: keyword in a
1.2 dm 547: .I distfile
548: to specify what messages are mailed to the
549: .B notify
550: address.
551: .RE
552: .LP
553: .I types
1.8 aaron 554: should be a comma separated list of message types. Each message type
1.2 dm 555: specified enables that message level. This is unlike the
556: .I syslog(3)
557: system facility which uses an ascending order scheme.
558: The following
1.8 aaron 559: are the valid
1.2 dm 560: .I types:
561: .RS
562: .IP \fBchange\fR
563: Things that change.
564: This includes files that are installed or updated in some way.
565: .IP \fBinfo\fR
566: General information.
567: .IP \fBnotice\fR
568: General info about things that change.
569: This includes things like making directories which are needed in order
570: to install a specific target, but which are not explicitly specified in
571: the
572: .I distfile.
573: .IP \fBnerror\fR
574: Normal errors that are not fatal.
575: .IP \fBferror\fR
576: Fatal errors.
577: .IP \fBwarning\fR
578: Warnings about errors which are not as serious as
579: .B nerror
580: type messages.
581: .IP \fBdebug\fR
582: Debugging information.
583: .IP \fBall\fR
584: All but debug messages.
585: .RE
586: .LP
587: Here is a sample command line option:
588: .nf
589: .sp
590: .RS
591: \-l stdout=all:syslog=change,notice:file=/tmp/rdist.log=all
592: .RE
593: .sp
594: .fi
595: This entry will set local message logging to have all but debug
596: messages sent to standard output, change and notice messages will
1.8 aaron 597: be sent to
1.2 dm 598: .I syslog(3),
599: and all messages will be written to the file
600: .B /tmp/rdist.log.
601: .SH DISTFILES
602: .PP
603: The
604: .I distfile
1.1 deraadt 605: contains a sequence of entries that specify the files
606: to be copied, the destination hosts, and what operations to perform
607: to do the updating. Each entry has one of the following formats.
1.2 dm 608: .nf
609:
610: .RS
1.1 deraadt 611: <variable name> `=' <name list>
1.2 dm 612: [ label: ] <source list> `\->' <destination list> <command list>
613: [ label: ] <source list> `::' <time_stamp file> <command list>
614: .RE
615:
616: .fi
1.1 deraadt 617: The first format is used for defining variables.
618: The second format is used for distributing files to other hosts.
619: The third format is used for making lists of files that have been changed
620: since some given date.
1.2 dm 621: The \fIsource list\fP specifies a
1.1 deraadt 622: list of files and/or directories on the local host which are to be used
623: as the master copy for distribution.
1.2 dm 624: The \fIdestination list\fP is the list of hosts to which these files are to be
1.1 deraadt 625: copied. Each file in the source list is added to a list of changes
626: if the file is out of date on the host which is being updated (second format) or
627: the file is newer than the time stamp file (third format).
1.2 dm 628: .PP
1.1 deraadt 629: Labels are optional. They are used to identify a command for partial updates.
1.2 dm 630: .PP
1.1 deraadt 631: Newlines, tabs, and blanks are only used as separators and are
632: otherwise ignored. Comments begin with `#' and end with a newline.
1.2 dm 633: .PP
1.1 deraadt 634: Variables to be expanded begin with `$' followed by one character or
635: a name enclosed in curly braces (see the examples at the end).
1.2 dm 636: .PP
1.1 deraadt 637: The source and destination lists have the following format:
1.2 dm 638: .nf
639:
640: .ti +.5i
1.1 deraadt 641: <name>
642: or
1.2 dm 643: .ti +.5i
1.10 aaron 644: `(' <zero or more names separated by whitespace> `)'
1.2 dm 645:
646: .fi
647: These simple lists can be modified by using one level of set addition,
648: subtraction, or intersection like this:
649: .nf
650:
651: .ti +.5i
652: list '-' list
653: or
654: .ti +.5i
655: list '+' list
656: or
657: .ti +.5i
658: list '&' list
659:
660: .fi
661: If additional modifications are needed (e.g., ``all servers and client
662: machines except for the OSF/1 machines'') then the list will have
663: to be explicitly constructed in steps using "temporary" variables.
664: .PP
1.1 deraadt 665: The shell meta-characters `[', `]', `{', `}', `*', and `?'
666: are recognized and expanded (on the local host only) in the same way as
1.2 dm 667: .IR csh (1).
1.1 deraadt 668: They can be escaped with a backslash.
669: The `~' character is also expanded in the same way as
1.2 dm 670: .IR csh
1.1 deraadt 671: but is expanded separately on the local and destination hosts.
672: When the
1.2 dm 673: .B \-o\fIwhole\fR
1.1 deraadt 674: option is used with a file name that begins with `~', everything except the
675: home directory is appended to the destination name.
676: File names which do not begin with `/' or `~' use the destination user's
677: home directory as the root directory for the rest of the file name.
1.2 dm 678: .PP
1.1 deraadt 679: The command list consists of zero or more commands of the following
680: format.
1.2 dm 681: .nf
682:
683: .RS
684: .ta \w'cmdspecial 'u +\w'name list 'u
685: `install' <options> opt_dest_name `;'
686: `notify' <name list> `;'
687: `except' <name list> `;'
688: `except_pat' <pattern list> `;'
689: `special' <name list> string `;'
690: `cmdspecial' <name list> string `;'
691: .RE
692:
693: .fi
694: .PP
1.1 deraadt 695: The
1.2 dm 696: .I install
1.1 deraadt 697: command is used to copy out of date files and/or directories.
698: Each source file is copied to each host in the destination list.
699: Directories are recursively copied in the same way.
1.2 dm 700: .I Opt_dest_name
1.1 deraadt 701: is an optional parameter to rename files.
702: If no
1.2 dm 703: .I install
1.1 deraadt 704: command appears in the command list or
705: the destination name is not specified,
706: the source file name is used.
707: Directories in the path name will be created if they
708: do not exist on the remote host.
1.2 dm 709: The
710: \fB\-o \fIdistopts\fR
711: option
712: as specified above under
713: .B OPTIONS,
714: has the same semantics as
715: on the command line except they only apply to the files
1.1 deraadt 716: in the source list.
717: The login name used on the destination host is the same as the local host
718: unless the destination name is of the format ``login@host".
1.2 dm 719: .PP
1.1 deraadt 720: The
1.2 dm 721: .I notify
1.1 deraadt 722: command is used to mail the list of files updated (and any errors
723: that may have occurred) to the listed names.
724: If no `@' appears in the name, the destination host is appended to
725: the name
726: (e.g., name1@host, name2@host, ...).
1.2 dm 727: .PP
1.1 deraadt 728: The
1.2 dm 729: .I except
1.1 deraadt 730: command is used to update all of the files in the source list
1.2 dm 731: .B except
732: for the files listed in \fIname list\fP.
1.1 deraadt 733: This is usually used to copy everything in a directory except certain files.
1.2 dm 734: .PP
1.1 deraadt 735: The
1.2 dm 736: .I except_pat
1.1 deraadt 737: command is like the
1.2 dm 738: .I except
739: command except that \fIpattern list\fP is a list of regular expressions
1.1 deraadt 740: (see
1.2 dm 741: .IR ed (1)
1.1 deraadt 742: for details).
743: If one of the patterns matches some string within a file name, that file will
744: be ignored.
745: Note that since `\e' is a quote character, it must be doubled to become
1.2 dm 746: part of the regular expression. Variables are expanded in \fIpattern list\fP
1.1 deraadt 747: but not shell file pattern matching characters. To include a `$', it
748: must be escaped with `\e'.
1.2 dm 749: .PP
1.1 deraadt 750: The
1.2 dm 751: .I special
1.1 deraadt 752: command is used to specify
1.2 dm 753: .IR sh (1)
1.1 deraadt 754: commands that are to be executed on the
1.2 dm 755: remote host after the file in \fIname list\fP is updated or installed.
756: If the \fIname list\fP is omitted then the shell commands will be executed
1.8 aaron 757: for every file updated or installed.
1.2 dm 758: .I String
1.1 deraadt 759: starts and ends with `"' and can cross multiple lines in
1.2 dm 760: .I distfile.
1.1 deraadt 761: Multiple commands to the shell should be separated by `;'.
762: Commands are executed in the user's home directory on the host
763: being updated.
764: The
1.2 dm 765: .I special
1.1 deraadt 766: command can be used to rebuild private databases, etc.
767: after a program has been updated.
1.8 aaron 768: The following environment variables are set for each
1.2 dm 769: .I special
770: command:
771: .IP \fBFILE\fR
772: The full pathname of the local file that was just updated.
773: .IP \fBREMFILE\fR
774: The full pathname of the remote file that was just updated.
775: .IP \fBBASEFILE\fR
776: The basename of the remote file that was just updated.
777: .PP
778: The
779: .I cmdspecial
780: command is similar to the
781: .I special
782: command, except it is executed only when the entire command is completed
783: instead of after each file is updated.
1.8 aaron 784: The list of files is placed in the environment variable
1.2 dm 785: .B $FILES.
786: Each file name in
787: .B $FILES
788: is separated by a `:' (colon).
789: .PP
790: If a hostname ends in a ``+'' (plus sign), then the plus
791: is stripped off and NFS checks are disabled.
792: This is equivalent to disabling the
793: .B \-o\fIchknfs\fR
794: option just for this one host.
795: .PP
796: The following is a small example.
797: .nf
798:
799: .RS
800: HOSTS = ( matisse root@arpa)
1.1 deraadt 801:
802: FILES = ( /bin /lib /usr/bin /usr/games
1.2 dm 803: /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}
804: /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )
1.1 deraadt 805:
806: EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc
1.2 dm 807: sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont )
1.1 deraadt 808:
809: ${FILES} -> ${HOSTS}
1.2 dm 810: install -oremove,chknfs ;
811: except /usr/lib/${EXLIB} ;
812: except /usr/games/lib ;
813: special /usr/lib/sendmail "/usr/lib/sendmail -bz" ;
1.1 deraadt 814:
815: srcs:
816: /usr/src/bin -> arpa
1.2 dm 817: except_pat ( \e\e.o\e$ /SCCS\e$ ) ;
1.1 deraadt 818:
819: IMAGEN = (ips dviimp catdvi)
820:
821: imagen:
822: /usr/local/${IMAGEN} -> arpa
1.2 dm 823: install /usr/local/lib ;
824: notify ralph ;
1.1 deraadt 825:
826: ${FILES} :: stamp.cory
1.2 dm 827: notify root@cory ;
828: .RE
829:
830: .fi
831: .SH ENVIRONMENT
832: .IP TMPDIR
1.8 aaron 833: Name of temporary directory to use. Default is
1.2 dm 834: .B /tmp.
1.5 millert 835: .IP RSH
836: Name of the default remote shell program to use. Default is
837: .B /usr/bin/rsh.
1.2 dm 838: .SH FILES
839: .nf
840: .ta \w'/tmp/rdist* 'u
841: distfile \- input command file
842: $TMPDIR/rdist* \- temporary file for update lists
843: .fi
844: .SH "SEE ALSO"
845: .B sh(1),
846: .B csh(1),
847: .B stat(2),
848: .B rsh(1c),
849: .B rcmd(3)
850: .SH DIAGNOSTICS
851: .SH NOTES
852: .LP
853: If the basename of a file (the last component in the pathname)
1.8 aaron 854: is ".", then
855: .B rdist
1.2 dm 856: assumes the remote (destination) name is a directory.
1.11 aaron 857: i.e.,
1.2 dm 858: .B /tmp/.
859: means that
860: .B /tmp
861: should be a directory on the remote host.
862: .LP
863: The following options are still recognized for backwards compatibility:
864: .sp
865: .RS
866: \-v \-N \-O \-q \-b \-r \-R \-s \-w \-y \-h \-i \-x
867: .RE
868: .sp
869: .SH BUGS
870: Source files must reside on the local host where rdist is executed.
871: .PP
1.1 deraadt 872: Variable expansion only works for name lists; there should be a general macro
873: facility.
1.2 dm 874: .PP
875: .I Rdist
1.1 deraadt 876: aborts on files which have a negative mtime (before Jan 1, 1970).
1.2 dm 877: .PP
878: If a hardlinked file is listed more than once in the same target,
1.8 aaron 879: then
880: .I rdist
1.2 dm 881: will report missing links.
882: Only one instance of a link should be listed in each target.