[BACK]Return to rdist.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / rdist

Annotation of src/usr.bin/rdist/rdist.1, Revision 1.3

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