[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.24

1.24    ! jmc         1: .\"    $OpenBSD: rdist.1,v 1.23 2007/02/26 15:53:12 jmc 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.
1.18      millert    14: .\" 3. Neither the name of the University nor the names of its contributors
1.1       deraadt    15: .\"    may be used to endorse or promote products derived from this software
                     16: .\"    without specific prior written permission.
                     17: .\"
                     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
                     28: .\" SUCH DAMAGE.
                     29: .\"
1.6       millert    30: .\"    $From: rdist.man,v 6.34 1996/01/29 22:37:19 mcooper Exp $
1.2       dm         31: .\"    @(#)rdist.1     6.6 (Berkeley) 5/13/86
1.1       deraadt    32: .\"
1.14      millert    33: .Dd May 9, 2002
                     34: .Dt RDIST 1
                     35: .Os
                     36: .Sh NAME
                     37: .Nm rdist
                     38: .Nd remote file distribution client program
                     39: .Sh SYNOPSIS
                     40: .Nm rdist
1.15      deraadt    41: .Bk -words
1.22      jmc        42: .Op Fl DFnV
                     43: .Op Fl Server
1.14      millert    44: .Op Fl A Ar num
                     45: .Op Fl a Ar num
1.22      jmc        46: .Op Fl c Ar mini_distfile
                     47: .Oo
                     48: .Fl d Ar var Ns = Ns Ar value
                     49: .Oc
1.14      millert    50: .Op Fl f Ar distfile
1.22      jmc        51: .Op Fl L Ar remote_logopts
                     52: .Op Fl l Ar local_logopts
1.14      millert    53: .Op Fl M Ar maxproc
                     54: .Op Fl m Ar host
                     55: .Op Fl o Ar distopts
1.22      jmc        56: .Op Fl P Ar rsh-path
                     57: .Op Fl p Ar rdistd-path
1.14      millert    58: .Op Fl t Ar timeout
                     59: .Op Ar name ...
1.15      deraadt    60: .Ek
1.14      millert    61: .Sh DESCRIPTION
                     62: .Nm
1.8       aaron      63: is a program to maintain identical copies of files over multiple hosts.
1.1       deraadt    64: It preserves the owner, group, mode, and mtime of files if possible and
                     65: can update programs that are executing.
1.14      millert    66: .Nm
1.1       deraadt    67: reads commands from
1.14      millert    68: .Pa distfile
1.1       deraadt    69: to direct the updating of files and/or directories.
                     70: If
1.14      millert    71: .Pa distfile
                     72: is
                     73: .Sq - ,
                     74: the standard input is used.
1.2       dm         75: If no
1.14      millert    76: .Fl f
                     77: option is present, the program looks first for
                     78: .Pa distfile ,
                     79: then
                     80: .Pa Distfile
                     81: to use as the input.
1.1       deraadt    82: If no names are specified on the command line,
1.14      millert    83: .Nm
1.1       deraadt    84: will update all of the files and directories listed in
1.14      millert    85: .Pa distfile .
1.1       deraadt    86: Otherwise, the argument is taken to be the name of a file to be updated
1.14      millert    87: or the label of a command to execute.
                     88: If label and file names conflict, it is assumed to be a label.
                     89: These may be used together to update specific files using specific commands.
                     90: .Pp
                     91: .Nm
1.13      millert    92: uses a remote shell command to access each target host.
                     93: By default,
1.14      millert    94: .Xr ssh 1
1.13      millert    95: is used, unless overridden by the
1.14      millert    96: .Fl P
                     97: option or the
                     98: .Ev RSH
                     99: environment variable.
1.13      millert   100: If the target host is the string
1.14      millert   101: .Em localhost
                    102: and the remote user name is the same as the local user name,
                    103: .Nm
1.24    ! jmc       104: will run the command:
1.14      millert   105: .Bd -literal -offset indent
                    106: /bin/sh -c rdistd -S
                    107: .Ed
                    108: .Pp
                    109: Otherwise,
                    110: .Nm
1.24    ! jmc       111: run will run the command:
1.14      millert   112: .Bd -literal -offset indent
1.24    ! jmc       113: ssh host -l remuser rdistd -S
1.14      millert   114: .Ed
                    115: .Pp
1.8       aaron     116: where
1.14      millert   117: .Em host
1.2       dm        118: is the name of the target host,
1.14      millert   119: .Em remuser
1.15      deraadt   120: is the name of the user to make the connection as, and
1.14      millert   121: .Em rdistd
1.2       dm        122: is the rdist server command on the target host as shown below.
1.14      millert   123: .Pp
1.2       dm        124: On each target host
1.14      millert   125: .Nm
1.2       dm        126: will attempt to run the command
1.14      millert   127: .Bd -literal -offset indent
                    128: rdistd -S
                    129: .Ed
1.2       dm        130: or
1.24    ! jmc       131: .Bd -literal -compact -offset indent
        !           132: \*(Ltrdistd path\*(Gt -S
1.14      millert   133: .Ed
                    134: .Pp
1.2       dm        135: if the
1.14      millert   136: .Fl p
1.2       dm        137: option was specified.
                    138: If no
1.14      millert   139: .Fl p
                    140: option is included, or the
1.24    ! jmc       141: .Aq Ar rdistd path
1.2       dm        142: is a simple filename,
1.24    ! jmc       143: .Xr rdistd 1
1.2       dm        144: or
1.24    ! jmc       145: .Aq Ar rdistd path
1.8       aaron     146: must be somewhere in the
1.14      millert   147: .Ev PATH
1.2       dm        148: of the user running
1.14      millert   149: .Nm
1.2       dm        150: on the remote (target) host.
1.14      millert   151: .Pp
                    152: The options are as follows:
                    153: .Bl -tag -width Ds
                    154: .It Fl A Ar num
1.2       dm        155: Set the minimum number of free files (inodes) on a filesystem that must exist
1.8       aaron     156: for
1.14      millert   157: .Nm
1.2       dm        158: to update or install a file.
1.14      millert   159: .It Fl a Ar num
1.2       dm        160: Set the minimum amount of free space (in bytes) on a filesystem that must exist
1.8       aaron     161: for
1.14      millert   162: .Nm
1.2       dm        163: to update or install a file.
1.22      jmc       164: .It Fl c Ar mini_distfile
                    165: Forces
                    166: .Nm
                    167: to interpret the remaining arguments as a small
                    168: .Pa distfile .
                    169: The equivalent distfile is as follows.
                    170: .Bd -literal -offset indent
1.24    ! jmc       171: (  name ... ) -\*(Gt [login@]host
        !           172:        install [dest] ;
1.22      jmc       173: .Ed
1.14      millert   174: .It Fl D
1.2       dm        175: Enable copious debugging messages.
1.22      jmc       176: .It Xo
                    177: .Fl d Ar var Ns = Ns Ar value
                    178: .Xc
1.1       deraadt   179: Define
1.14      millert   180: .Ar var
1.1       deraadt   181: to have
1.14      millert   182: .Ar value .
1.2       dm        183: This
1.1       deraadt   184: option is used to define or override variable definitions in the
1.14      millert   185: .Pa distfile .
                    186: .Ar value
1.1       deraadt   187: can be the empty string, one name, or a list of names surrounded by
                    188: parentheses and separated by tabs and/or spaces.
1.14      millert   189: .It Fl F
1.8       aaron     190: Do not fork any child
1.14      millert   191: .Nm
1.2       dm        192: processes.
                    193: All clients are updated sequentially.
1.14      millert   194: .It Fl f Ar distfile
1.2       dm        195: Set the name of the distfile to use to be
1.14      millert   196: .Ar distfile .
1.8       aaron     197: If
1.14      millert   198: .Ar distfile
1.2       dm        199: is specified as
1.14      millert   200: .Dq -
                    201: (dash) then read from standard input (stdin).
1.22      jmc       202: .It Fl L Ar remote_logopts
                    203: Set remote logging options.
                    204: .Ar logopts
                    205: is the same as for local logging except the values are passed to the remote
1.24    ! jmc       206: server,
        !           207: .Xr rdistd 1 .
1.8       aaron     208: See the section
1.14      millert   209: .Sy MESSAGE LOGGING
1.2       dm        210: for details on the syntax for
1.14      millert   211: .Ar logopts .
1.22      jmc       212: .It Fl l Ar local_logopts
                    213: Set local logging options.
1.8       aaron     214: See the section
1.14      millert   215: .Sy MESSAGE LOGGING
1.2       dm        216: for details on the syntax for
1.14      millert   217: .Ar logopts .
1.22      jmc       218: .It Fl M Ar maxproc
1.14      millert   219: Set the maximum number of simultaneously running child
                    220: .Nm
1.2       dm        221: processes to
1.22      jmc       222: .Ar maxproc .
1.2       dm        223: The default is 4.
1.22      jmc       224: .It Fl m Ar host
1.19      jmc       225: Limit which machines are to be updated.
                    226: Multiple
1.14      millert   227: .Fl m
1.1       deraadt   228: arguments can be given to limit updates to a subset of the hosts listed in the
1.14      millert   229: .Pa distfile .
                    230: .It Fl n
                    231: Print the commands without executing them.
                    232: This option is useful for debugging a
                    233: .Pa distfile .
1.22      jmc       234: .It Fl o Ar distopts
1.2       dm        235: Specify the dist options to enable.
1.14      millert   236: .Ar distopts
1.2       dm        237: is a comma separated list of options which are listed below.
                    238: The valid values for
1.14      millert   239: .Ar distopts
1.2       dm        240: are:
1.14      millert   241: .Bl -tag -width Ds
1.22      jmc       242: .It Ic chknfs
1.14      millert   243: Do not check or update files on target host that reside on NFS filesystems.
1.22      jmc       244: .It Ic chkreadonly
1.14      millert   245: Enable check on target host to see if a file resides on a read-only filesystem.
1.2       dm        246: If a file does, then no checking or updating of the file is attempted.
1.22      jmc       247: .It Ic chksym
1.2       dm        248: If the target on the remote host is a symbolic link, but is not on the
                    249: master host, the remote target will be left a symbolic link.
                    250: This behavior is generally considered a bug in the original version of
1.14      millert   251: .Nm rdist ,
1.2       dm        252: but is present to allow compatibility with older versions.
1.22      jmc       253: .It Ic compare
                    254: Binary comparison.
                    255: Perform a binary comparison and update files if they differ rather than
                    256: comparing dates and sizes.
                    257: .It Ic defgroup Ns Op = Ns Ic groupname
1.17      millert   258: If the group of a file to be transferred does not exist on the destination
                    259: host, use the specified group instead.
                    260: If groupname is not specified, the
                    261: .Em bin
                    262: group is used.
1.22      jmc       263: .It Ic defowner Ns Op = Ns Ic owner
1.17      millert   264: If the owner of a file to be transferred does not exist on the destination
                    265: host, use the specified owner instead.
                    266: If owner is not specified, the user
                    267: .Em bin
                    268: is used.
1.22      jmc       269: .It Ic follow
                    270: Follow symbolic links.
                    271: Copy the file that the link points to rather than the link itself.
                    272: .It Ic history
                    273: When
                    274: .Ic savetargets
                    275: and
                    276: .Ic history
                    277: are both defined then the target file that is updated is first renamed from
                    278: .Pa file
                    279: to
                    280: .Pa file.NNN
                    281: where NNN increases for each generation update.
                    282: The first generation is 001, and the last is 999.
                    283: After 999 generations, the counter is reset to 001 and 001 will get
                    284: overwritten all the time.
                    285: This is undesirable behavior, so some other method needs to be devised
                    286: to clean up or limit the number of generations.
                    287: .It Ic ignlnks
                    288: Ignore unresolved links.
                    289: .Nm
                    290: will normally try to maintain the link structure of files being transferred
                    291: and warn the user if all the links cannot be found.
                    292: .It Ic nochkgroup
1.2       dm        293: Do not check group ownership of files that already exist.
                    294: The file ownership is only set when the file is updated.
1.22      jmc       295: .It Ic nochkmode
1.2       dm        296: Do not check file and directory permission modes.
                    297: The permission mode is only set when the file is updated.
1.22      jmc       298: .It Ic nochkowner
                    299: Do not check user ownership of files that already exist.
                    300: The file ownership is only set when the file is updated.
                    301: .It Ic nodescend
1.2       dm        302: Do not descend into a directory.
1.14      millert   303: Normally,
                    304: .Nm
1.2       dm        305: will recursively check directories.
1.14      millert   306: If this option is enabled, then any files listed in the file list in the
                    307: distfile that are directories are not recursively scanned.
1.2       dm        308: Only the existence, ownership, and mode of the directory are checked.
1.22      jmc       309: .It Ic noexec
                    310: Automatically exclude executable files that are in
                    311: .Xr a.out 5
                    312: format from being checked or updated.
                    313: .It Ic numchkgroup
1.9       aaron     314: Use the numeric group ID (GID) to check group ownership instead of
1.2       dm        315: the group name.
1.22      jmc       316: .It Ic numchkowner
1.9       aaron     317: Use the numeric user ID (UID) to check user ownership instead of
1.2       dm        318: the user name.
1.22      jmc       319: .It Ic quiet
                    320: Quiet mode.
                    321: Files that are being modified are normally printed on standard output.
                    322: This option suppresses that.
                    323: .It Ic remove
                    324: Remove extraneous files.
                    325: If a directory is being updated, any files that exist on the remote host
                    326: that do not exist in the master directory are removed.
                    327: This is useful for maintaining truly identical copies of directories.
                    328: .It Ic savetargets
1.2       dm        329: Save files that are updated instead of removing them.
1.15      deraadt   330: Any target file that is updated is first renamed from
1.14      millert   331: .Pa file
1.2       dm        332: to
1.14      millert   333: .Pa file.OLD .
1.22      jmc       334: .It Ic sparse
1.14      millert   335: Enable checking for sparse (aka
                    336: .Dq wholely )
                    337: files.
                    338: One of the most common types of sparse files are those produced by
                    339: .Xr db 3 .
1.3       dm        340: This option adds some additional processing overhead so it should
                    341: only be enabled for targets likely to contain sparse files.
1.22      jmc       342: .It Ic updateperm
                    343: Do not send the whole file when the size and the modification time match.
                    344: Instead, just update the ownership, group, and permissions as necessary.
                    345: .It Ic verify
                    346: Verify that the files are up to date on all the hosts.
                    347: Any files that are out of date will be displayed but no files will be
                    348: changed nor will any mail be sent.
                    349: .It Ic whole
                    350: Whole mode.
                    351: The whole file name is appended to the destination directory name.
                    352: Normally, only the last component of a name is used when renaming files.
                    353: This will preserve the directory structure of the files being
                    354: copied instead of flattening the directory structure.
                    355: For example, rdisting a list of files such as
                    356: .Pa /path/dir1/f1
                    357: and
                    358: .Pa /path/dir2/f2
                    359: to
                    360: .Pa /tmp/dir
                    361: would create files
                    362: .Pa /tmp/dir/path/dir1/f1
                    363: and
                    364: .Pa /tmp/dir/path/dir2/f2
                    365: instead of
                    366: .Pa /tmp/dir/dir1/f1
                    367: and
                    368: .Pa /tmp/dir/dir2/f2 .
                    369: .It Ic younger
                    370: Younger mode.
                    371: Files are normally updated if their
                    372: .Em mtime
                    373: and
                    374: .Em size
                    375: (see
                    376: .Xr stat 2 )
                    377: disagree.
                    378: This option causes
                    379: .Nm
                    380: not to update files that are younger than the master copy.
                    381: This can be used to prevent newer copies on other hosts from being replaced.
                    382: A warning message is printed for files which are newer than the master copy.
1.14      millert   383: .El
1.22      jmc       384: .It Fl P Ar rsh-path
1.14      millert   385: Set the path to the remote shell command.
1.2       dm        386: The
1.21      jmc       387: .Ar rsh-path
1.7       deraadt   388: may be a colon separated list of possible pathnames.
1.2       dm        389: In this case, the first component of the path to exist is used.
1.24    ! jmc       390: For example,
1.14      millert   391: .Pa "/usr/bin/ssh:/usr/bin/rsh" ,
                    392: .Pa /usr/bin/ssh .
1.22      jmc       393: .It Fl p Ar rdistd-path
                    394: Set the path where the rdistd server is searched for on the target host.
                    395: .It Fl Server
                    396: This option is recognized to provide partial backward compatible support
                    397: for older versions of
                    398: .Nm
                    399: which used this option to put
                    400: .Nm
                    401: into server mode.
                    402: If
                    403: .Nm
                    404: is started with the
                    405: .Fl Server
                    406: command line option, it will attempt to exec (run) the old version of
                    407: .Nm rdist ,
                    408: .Pa /usr/bin/oldrdist .
1.14      millert   409: .It Fl t Ar timeout
1.8       aaron     410: Set the timeout period (in seconds) for waiting for responses from the remote
1.14      millert   411: .Nm
1.2       dm        412: server.
                    413: The default is 900 seconds.
1.14      millert   414: .It Fl V
1.2       dm        415: Print version information and exit.
1.16      jmc       416: .El
1.14      millert   417: .Sh DISTFILES
1.2       dm        418: The
1.14      millert   419: .Pa distfile
1.1       deraadt   420: contains a sequence of entries that specify the files
                    421: to be copied, the destination hosts, and what operations to perform
1.19      jmc       422: to do the updating.
                    423: Each entry has one of the following formats.
1.14      millert   424: .Bd -literal -offset indent
1.24    ! jmc       425: \*(Ltvariable name\*(Gt `=' \*(Ltname list\*(Gt
        !           426: [ label: ] \*(Ltsource list\*(Gt `\-\*(Gt' \*(Ltdestination list\*(Gt \*(Ltcommand list\*(Gt
        !           427: [ label: ] \*(Ltsource list\*(Gt `::' \*(Lttime_stamp file\*(Gt \*(Ltcommand list\*(Gt
1.14      millert   428: .Ed
                    429: .Pp
1.1       deraadt   430: The first format is used for defining variables.
                    431: The second format is used for distributing files to other hosts.
                    432: The third format is used for making lists of files that have been changed
                    433: since some given date.
1.14      millert   434: The
                    435: .Em source list
                    436: specifies a list of files and/or directories on the local host which are to
                    437: be used as the master copy for distribution.
                    438: The
                    439: .Em destination list
                    440: is the list of hosts to which these files are to be copied.
                    441: Each file in the source list is added to a list of changes if the file
                    442: is out of date on the host which is being updated (second format) or
1.1       deraadt   443: the file is newer than the time stamp file (third format).
1.14      millert   444: .Pp
                    445: Labels are optional.
                    446: They are used to identify a command for partial updates.
                    447: .Pp
1.1       deraadt   448: Newlines, tabs, and blanks are only used as separators and are
1.14      millert   449: otherwise ignored.
                    450: Comments begin with
                    451: .Sq #
                    452: and end with a newline.
                    453: .Pp
                    454: Variables to be expanded begin with
                    455: .Sq $
                    456: followed by one character or a name enclosed in curly braces
                    457: (see the examples at the end).
                    458: .Pp
1.1       deraadt   459: The source and destination lists have the following format:
1.14      millert   460: .Bd -literal -offset indent
1.24    ! jmc       461: \*(Ltname\*(Gt
1.14      millert   462: .Ed
1.1       deraadt   463: or
1.14      millert   464: .Bd -literal -compact -offset indent
1.24    ! jmc       465: `(' \*(Ltzero or more names separated by whitespace\*(Gt `)'
1.14      millert   466: .Ed
                    467: .Pp
1.2       dm        468: These simple lists can be modified by using one level of set addition,
                    469: subtraction, or intersection like this:
1.14      millert   470: .Bd -literal -offset indent
1.2       dm        471: list '-' list
1.14      millert   472: .Ed
1.2       dm        473: or
1.14      millert   474: .Bd -literal -compact -offset indent
1.2       dm        475: list '+' list
1.14      millert   476: .Ed
1.2       dm        477: or
1.14      millert   478: .Bd -literal -compact -offset indent
1.2       dm        479: list '&' list
1.14      millert   480: .Ed
                    481: .Pp
1.24    ! jmc       482: If additional modifications are needed (e.g.\&
1.14      millert   483: .Do
                    484: all servers and client machines except for the OSF/1 machines
                    485: .Dc )
                    486: then the list will have to be explicitly constructed in steps using
                    487: .Dq temporary
                    488: variables.
                    489: .Pp
1.1       deraadt   490: The shell meta-characters `[', `]', `{', `}', `*', and `?'
                    491: are recognized and expanded (on the local host only) in the same way as
1.14      millert   492: .Xr csh 1 .
1.1       deraadt   493: They can be escaped with a backslash.
                    494: The `~' character is also expanded in the same way as
1.14      millert   495: .Xr csh 1
1.1       deraadt   496: but is expanded separately on the local and destination hosts.
                    497: When the
1.14      millert   498: .Fl o Ns Ar whole
1.1       deraadt   499: option is used with a file name that begins with `~', everything except the
                    500: home directory is appended to the destination name.
                    501: File names which do not begin with `/' or `~' use the destination user's
                    502: home directory as the root directory for the rest of the file name.
1.14      millert   503: .Pp
1.1       deraadt   504: The command list consists of zero or more commands of the following
                    505: format.
1.24    ! jmc       506: .Bl -column "except_pat" "pattern listXX" "opt_dest_name" ";" -offset indent
        !           507: .\" .It `install' Ta \*(Ltoptions\*(Gt Ta opt_dest_name Ta `;'
        !           508: .\" .It `notify' Ta \*(Ltname list\*(Gt Ta "" Ta `;'
        !           509: .\" .It `except' Ta \*(Ltname list\*(Gt Ta "" Ta `;'
        !           510: .\" .It `except_pat' Ta \*(Ltpattern list\*(Gt Ta "" Ta `;'
        !           511: .\" .It `special' Ta \*(Ltname list\*(Gt Ta string Ta `;'
        !           512: .\" .It `cmdspecial' Ta \*(Ltname list\*(Gt Ta string Ta `;'
1.14      millert   513: .El
                    514: .Pp
1.1       deraadt   515: The
1.14      millert   516: .Em install
1.1       deraadt   517: command is used to copy out of date files and/or directories.
                    518: Each source file is copied to each host in the destination list.
                    519: Directories are recursively copied in the same way.
1.14      millert   520: .Em opt_dest_name
1.1       deraadt   521: is an optional parameter to rename files.
                    522: If no
1.14      millert   523: .Em install
                    524: command appears in the command list or the destination name is not specified,
1.1       deraadt   525: the source file name is used.
                    526: Directories in the path name will be created if they
                    527: do not exist on the remote host.
1.2       dm        528: The
1.14      millert   529: .Fl o Ns Ar distopts
                    530: option as specified above has the same semantics as
                    531: on the command line except
                    532: .Ar distopts
                    533: only apply to the files in the source list.
1.1       deraadt   534: The login name used on the destination host is the same as the local host
1.14      millert   535: unless the destination name is of the format
                    536: .Dq login@host .
                    537: .Pp
1.1       deraadt   538: The
1.14      millert   539: .Em notify
1.1       deraadt   540: command is used to mail the list of files updated (and any errors
                    541: that may have occurred) to the listed names.
                    542: If no `@' appears in the name, the destination host is appended to
                    543: the name
1.24    ! jmc       544: (e.g. name1@host, name2@host, ...).
1.14      millert   545: .Pp
1.1       deraadt   546: The
1.14      millert   547: .Em except
1.1       deraadt   548: command is used to update all of the files in the source list
1.14      millert   549: .Sy except
                    550: for the files listed in
                    551: .Em name list .
1.1       deraadt   552: This is usually used to copy everything in a directory except certain files.
1.14      millert   553: .Pp
1.1       deraadt   554: The
1.14      millert   555: .Em except_pat
1.1       deraadt   556: command is like the
1.14      millert   557: .Em except
                    558: command except that
                    559: .Em pattern list
                    560: is a list of regular expressions
1.1       deraadt   561: (see
1.14      millert   562: .Xr ed 1
1.1       deraadt   563: for details).
                    564: If one of the patterns matches some string within a file name, that file will
                    565: be ignored.
                    566: Note that since `\e' is a quote character, it must be doubled to become
1.14      millert   567: part of the regular expression.
                    568: Variables are expanded in
                    569: .Em pattern list
                    570: but not shell file pattern matching characters.
                    571: To include a `$', it must be escaped with `\e'.
                    572: .Pp
1.1       deraadt   573: The
1.14      millert   574: .Em special
1.1       deraadt   575: command is used to specify
1.14      millert   576: .Xr sh 1
                    577: commands that are to be executed on the remote host after the file in
                    578: .Em name list
                    579: is updated or installed.
                    580: If the
                    581: .Em name list
                    582: is omitted then the shell commands will be executed for every file
                    583: updated or installed.
                    584: .Em string
1.1       deraadt   585: starts and ends with `"' and can cross multiple lines in
1.19      jmc       586: .Pa distfile .
1.1       deraadt   587: Multiple commands to the shell should be separated by `;'.
                    588: Commands are executed in the user's home directory on the host
                    589: being updated.
                    590: The
1.14      millert   591: .Em special
1.1       deraadt   592: command can be used to rebuild private databases, etc.
                    593: after a program has been updated.
1.8       aaron     594: The following environment variables are set for each
1.14      millert   595: .Em special
1.2       dm        596: command:
1.14      millert   597: .Bl -tag -width "BASEFILE"
                    598: .It Ev FILE
1.2       dm        599: The full pathname of the local file that was just updated.
1.14      millert   600: .It Ev REMFILE
1.2       dm        601: The full pathname of the remote file that was just updated.
1.14      millert   602: .It BASEFILE
1.2       dm        603: The basename of the remote file that was just updated.
1.14      millert   604: .El
                    605: .Pp
1.2       dm        606: The
1.14      millert   607: .Em cmdspecial
1.2       dm        608: command is similar to the
1.14      millert   609: .Em special
1.2       dm        610: command, except it is executed only when the entire command is completed
                    611: instead of after each file is updated.
1.14      millert   612: The list of files is placed in the
                    613: .Ev FILES
                    614: environment variable.
1.2       dm        615: Each file name in
1.14      millert   616: .Ev FILES
1.2       dm        617: is separated by a `:' (colon).
1.14      millert   618: .Pp
                    619: If a hostname ends in a `+' (plus sign), then the plus
1.2       dm        620: is stripped off and NFS checks are disabled.
                    621: This is equivalent to disabling the
1.14      millert   622: .Fl o Ns Ar chknfs
1.2       dm        623: option just for this one host.
1.23      jmc       624: .Sh MESSAGE LOGGING
                    625: .Nm
                    626: uses a collection of predefined message
                    627: .Em facilities
                    628: that each contain a list of message
                    629: .Sy types
                    630: specifying which types of messages to send to that
                    631: .Em facility .
1.24    ! jmc       632: The local client
        !           633: .Pq Nm rdist
        !           634: and the remote server
        !           635: .Pq Xr rdistd 1
        !           636: each maintain their own copy
        !           637: of what types of messages to log to what facilities.
1.23      jmc       638: .Pp
                    639: The
                    640: .Fl l
1.24    ! jmc       641: .Ar local_logopts
1.23      jmc       642: option to
                    643: .Nm
                    644: tells
                    645: .Nm
                    646: what logging options to use locally.
                    647: The
                    648: .Fl L
1.24    ! jmc       649: .Ar remote_logopts
1.23      jmc       650: option to
                    651: .Nm
                    652: tells
                    653: .Nm
                    654: what logging options to pass to the remote
                    655: .Em rdistd
                    656: server.
1.14      millert   657: .Pp
1.23      jmc       658: .Em logopts
1.24    ! jmc       659: should be of the form:
        !           660: .Pp
        !           661: .D1 facility=types:facility=types...
1.23      jmc       662: .Pp
                    663: The valid facility names are:
                    664: .Bl -tag -width Ds
1.24    ! jmc       665: .It Ic stdout
1.23      jmc       666: Messages to standard output.
1.24    ! jmc       667: .It Ic file
1.23      jmc       668: Log to a file.
                    669: To specify the file name, use the format
1.24    ! jmc       670: .Dq file=filename=types .
        !           671: For example:
        !           672: .Pp
        !           673: .Dl file=/tmp/rdist.log=all,debug
        !           674: .It Ic syslog
1.23      jmc       675: Use the
                    676: .Xr syslogd 8
                    677: facility.
1.24    ! jmc       678: .It Ic notify
1.23      jmc       679: Use the internal
                    680: .Nm
1.24    ! jmc       681: .Ic notify
1.23      jmc       682: facility.
                    683: This facility is used in conjunction with the
1.24    ! jmc       684: .Ic notify
1.23      jmc       685: keyword in a
                    686: .Pa distfile
                    687: to specify what messages are mailed to the
1.24    ! jmc       688: .Ic notify
1.23      jmc       689: address.
                    690: .El
                    691: .Pp
                    692: .Em types
                    693: should be a comma separated list of message types.
                    694: Each message type specified enables that message level.
                    695: This is unlike the
                    696: .Xr syslog 3
                    697: system facility which uses an ascending order scheme.
                    698: The following are the valid
                    699: .Em types :
                    700: .Bl -tag -width Ds
1.24    ! jmc       701: .It Ic change
1.23      jmc       702: Things that change.
                    703: This includes files that are installed or updated in some way.
1.24    ! jmc       704: .It Ic info
1.23      jmc       705: General information.
1.24    ! jmc       706: .It Ic notice
1.23      jmc       707: General info about things that change.
                    708: This includes things like making directories which are needed in order
                    709: to install a specific target, but which are not explicitly specified in the
                    710: .Pa distfile .
1.24    ! jmc       711: .It Ic nerror
1.23      jmc       712: Normal errors that are not fatal.
1.24    ! jmc       713: .It Ic ferror
1.23      jmc       714: Fatal errors.
1.24    ! jmc       715: .It Ic warning
1.23      jmc       716: Warnings about errors which are not as serious as
1.24    ! jmc       717: .Ic nerror
1.23      jmc       718: type messages.
1.24    ! jmc       719: .It Ic debug
1.23      jmc       720: Debugging information.
1.24    ! jmc       721: .It Ic all
1.23      jmc       722: All but debug messages.
                    723: .El
                    724: .Pp
                    725: Here is a sample command line option:
                    726: .Bd -literal -offset indent
                    727: -l stdout=all:syslog=change,notice:file=/tmp/rdist.log=all
                    728: .Ed
                    729: .Pp
                    730: This entry will set local message logging to have all but debug
                    731: messages sent to standard output, change and notice messages will
                    732: be sent to
                    733: .Xr syslog 3 ,
                    734: and all messages will be written to the file
                    735: .Pa /tmp/rdist.log .
                    736: .Sh ENVIRONMENT
                    737: .Bl -tag -width "TMPDIR"
                    738: .It TMPDIR
                    739: Name of temporary directory to use.
                    740: Default is
                    741: .Pa /tmp .
                    742: .It RSH
                    743: Name of the default remote shell program to use.
                    744: Default is
                    745: .Xr ssh 1 .
                    746: .El
                    747: .Sh FILES
                    748: .Bl -tag -width "$TMPDIR/rdist*" -compact
                    749: .It distfile
                    750: input command file
                    751: .It $TMPDIR/rdist*
                    752: temporary file for update lists
                    753: .El
                    754: .Sh EXAMPLES
1.14      millert   755: .Bd -literal -offset indent
1.2       dm        756: HOSTS = ( matisse root@arpa)
1.1       deraadt   757:
                    758: FILES = ( /bin /lib /usr/bin /usr/games
1.2       dm        759:        /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}
                    760:        /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )
1.1       deraadt   761:
1.14      millert   762: EXLIB = ( Mail.rc aliases aliases.db crontab dshrc
                    763:        sendmail.cf sendmail.hf sendmail.st uucp vfont )
1.1       deraadt   764:
1.24    ! jmc       765: ${FILES} -\*(Gt ${HOSTS}
1.2       dm        766:        install -oremove,chknfs ;
                    767:        except /usr/lib/${EXLIB} ;
                    768:        except /usr/games/lib ;
1.14      millert   769:        special /usr/lib/sendmail "/usr/lib/sendmail -bi" ;
1.1       deraadt   770:
                    771: srcs:
1.24    ! jmc       772: /usr/src/bin -\*(Gt arpa
1.2       dm        773:        except_pat ( \e\e.o\e$ /SCCS\e$ ) ;
1.1       deraadt   774:
                    775: IMAGEN = (ips dviimp catdvi)
                    776:
                    777: imagen:
1.24    ! jmc       778: /usr/local/${IMAGEN} -\*(Gt arpa
1.2       dm        779:        install /usr/local/lib ;
                    780:        notify ralph ;
1.1       deraadt   781:
                    782: ${FILES} :: stamp.cory
1.2       dm        783:        notify root@cory ;
1.14      millert   784: .Ed
                    785: .Sh SEE ALSO
                    786: .Xr csh 1 ,
                    787: .Xr rsh 1 ,
1.19      jmc       788: .Xr sh 1 ,
1.14      millert   789: .Xr ssh 1 ,
                    790: .Xr stat 2 ,
                    791: .Xr rcmdsh 3
1.23      jmc       792: .Sh STANDARDS
                    793: The options
                    794: .Op Fl bhiNOqRrsvwxy
                    795: are still recognized for backwards compatibility.
                    796: .Sh CAVEATS
1.14      millert   797: If the basename of a file  (the last component in the pathname) is ".", then
                    798: .Nm
1.2       dm        799: assumes the remote (destination) name is a directory.
1.24    ! jmc       800: That is,
1.14      millert   801: .Pa /tmp/ .
1.2       dm        802: means that
1.14      millert   803: .Pa /tmp
1.2       dm        804: should be a directory on the remote host.
1.14      millert   805: .Sh BUGS
1.2       dm        806: Source files must reside on the local host where rdist is executed.
1.14      millert   807: .Pp
1.1       deraadt   808: Variable expansion only works for name lists; there should be a general macro
                    809: facility.
1.14      millert   810: .Pp
                    811: .Nm
1.1       deraadt   812: aborts on files which have a negative mtime (before Jan 1, 1970).
1.14      millert   813: .Pp
1.2       dm        814: If a hardlinked file is listed more than once in the same target,
1.8       aaron     815: then
1.14      millert   816: .Nm
1.2       dm        817: will report missing links.
                    818: Only one instance of a link should be listed in each target.
1.17      millert   819: .Pp
1.19      jmc       820: The
                    821: .Sy defowner ,
                    822: .Sy defgroup ,
1.17      millert   823: and
                    824: .Sy updateperm
                    825: options are extensions to the 6.1.0 protocol and will not work with earlier
                    826: versions of rdist 6.