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

1.23    ! jmc         1: .\"    $OpenBSD: rdist.1,v 1.22 2007/02/26 15:38:04 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.2       dm        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.2       dm        111: run will run the command
1.14      millert   112: .Bd -literal -offset indent
1.13      millert   113: \fBssh \fIhost\fB -l \fIremuser \fBrdistd -S\fR
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
                    130: .Pp
1.2       dm        131: or
1.14      millert   132: .Bd -literal -offset indent
                    133: <rdistd path> -S
                    134: .Ed
                    135: .Pp
1.2       dm        136: if the
1.14      millert   137: .Fl p
1.2       dm        138: option was specified.
                    139: If no
1.14      millert   140: .Fl p
                    141: option is included, or the
                    142: .Ar <rdistd path>
1.2       dm        143: is a simple filename,
1.14      millert   144: .Em rdistd
1.2       dm        145: or
1.14      millert   146: .Em <rdistd path>
1.8       aaron     147: must be somewhere in the
1.14      millert   148: .Ev PATH
1.2       dm        149: of the user running
1.14      millert   150: .Nm
1.2       dm        151: on the remote (target) host.
1.14      millert   152: .Pp
                    153: The options are as follows:
                    154: .Bl -tag -width Ds
                    155: .It Fl A Ar num
1.2       dm        156: Set the minimum number of free files (inodes) on a filesystem that must exist
1.8       aaron     157: for
1.14      millert   158: .Nm
1.2       dm        159: to update or install a file.
1.14      millert   160: .It Fl a Ar num
1.2       dm        161: Set the minimum amount of free space (in bytes) on a filesystem that must exist
1.8       aaron     162: for
1.14      millert   163: .Nm
1.2       dm        164: to update or install a file.
1.22      jmc       165: .It Fl c Ar mini_distfile
                    166: Forces
                    167: .Nm
                    168: to interpret the remaining arguments as a small
                    169: .Pa distfile .
                    170: The equivalent distfile is as follows.
                    171: .Bd -literal -offset indent
                    172: ( \fIname\fP ... ) -> [\fIlogin\fP@]\fIhost\fP
                    173:        install [\fIdest\fP] ;
                    174: .Ed
1.14      millert   175: .It Fl D
1.2       dm        176: Enable copious debugging messages.
1.22      jmc       177: .It Xo
                    178: .Fl d Ar var Ns = Ns Ar value
                    179: .Xc
1.1       deraadt   180: Define
1.14      millert   181: .Ar var
1.1       deraadt   182: to have
1.14      millert   183: .Ar value .
1.2       dm        184: This
1.1       deraadt   185: option is used to define or override variable definitions in the
1.14      millert   186: .Pa distfile .
                    187: .Ar value
1.1       deraadt   188: can be the empty string, one name, or a list of names surrounded by
                    189: parentheses and separated by tabs and/or spaces.
1.14      millert   190: .It Fl F
1.8       aaron     191: Do not fork any child
1.14      millert   192: .Nm
1.2       dm        193: processes.
                    194: All clients are updated sequentially.
1.14      millert   195: .It Fl f Ar distfile
1.2       dm        196: Set the name of the distfile to use to be
1.14      millert   197: .Ar distfile .
1.8       aaron     198: If
1.14      millert   199: .Ar distfile
1.2       dm        200: is specified as
1.14      millert   201: .Dq -
                    202: (dash) then read from standard input (stdin).
1.22      jmc       203: .It Fl L Ar remote_logopts
                    204: Set remote logging options.
                    205: .Ar logopts
                    206: is the same as for local logging except the values are passed to the remote
                    207: server (\fIrdistd\fR).
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.14      millert   390: e.g.,
                    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.1       deraadt   425: <variable name> `=' <name list>
1.2       dm        426: [ label: ] <source list> `\->' <destination list> <command list>
                    427: [ label: ] <source list> `::' <time_stamp file> <command list>
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.1       deraadt   461: <name>
1.14      millert   462: .Ed
1.1       deraadt   463: or
1.14      millert   464: .Bd -literal -compact -offset indent
1.10      aaron     465: `(' <zero or more names separated by whitespace> `)'
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
                    482: If additional modifications are needed (e.g.,
                    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.14      millert   506: .Bl -column "except_pat" "<pattern list>" "opt_dest_name" ";" -offset indent
                    507: .It `install' Ta <options> Ta opt_dest_name Ta `;'
                    508: .It `notify' Ta <name list> Ta "" Ta `;'
                    509: .It `except' Ta <name list> Ta "" Ta `;'
                    510: .It `except_pat' Ta <pattern list> Ta "" Ta `;'
                    511: .It `special' Ta <name list> Ta string Ta `;'
                    512: .It `cmdspecial' Ta <name list> Ta string Ta `;'
                    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
                    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 .
        !           632: The local client (\fIrdist\fR) and the remote server (\fIrdistd\fR) each
        !           633: maintain their own copy of what types of messages to log to what facilities.
        !           634: .Pp
        !           635: The
        !           636: .Fl l
        !           637: .Em logopts
        !           638: option to
        !           639: .Nm
        !           640: tells
        !           641: .Nm
        !           642: what logging options to use locally.
        !           643: The
        !           644: .Fl L
        !           645: .Em logopts
        !           646: option to
        !           647: .Nm
        !           648: tells
        !           649: .Nm
        !           650: what logging options to pass to the remote
        !           651: .Em rdistd
        !           652: server.
1.14      millert   653: .Pp
1.23    ! jmc       654: .Em logopts
        !           655: should be of the form
        !           656: .Bd -literal -offset indent
        !           657: \fIfacility\fB=\fItypes\fB:\fIfacility\fB=\fItypes...
        !           658: .Ed
        !           659: .Pp
        !           660: The valid facility names are:
        !           661: .Bl -tag -width Ds
        !           662: .It Sy stdout
        !           663: Messages to standard output.
        !           664: .It Sy file
        !           665: Log to a file.
        !           666: To specify the file name, use the format
        !           667: .Dq \fBfile=\fIfilename\fB=\fItypes\fR .
        !           668: e.g.,
        !           669: .Dq \fBfile=\fI/tmp/rdist.log\fB=\fIall,debug\fR .
        !           670: .It Sy syslog
        !           671: Use the
        !           672: .Xr syslogd 8
        !           673: facility.
        !           674: .It Sy notify
        !           675: Use the internal
        !           676: .Nm
        !           677: .Sy notify
        !           678: facility.
        !           679: This facility is used in conjunction with the
        !           680: .Sy notify
        !           681: keyword in a
        !           682: .Pa distfile
        !           683: to specify what messages are mailed to the
        !           684: .Sy notify
        !           685: address.
        !           686: .El
        !           687: .Pp
        !           688: .Em types
        !           689: should be a comma separated list of message types.
        !           690: Each message type specified enables that message level.
        !           691: This is unlike the
        !           692: .Xr syslog 3
        !           693: system facility which uses an ascending order scheme.
        !           694: The following are the valid
        !           695: .Em types :
        !           696: .Bl -tag -width Ds
        !           697: .It Sy change
        !           698: Things that change.
        !           699: This includes files that are installed or updated in some way.
        !           700: .It Sy info
        !           701: General information.
        !           702: .It Sy notice
        !           703: General info about things that change.
        !           704: This includes things like making directories which are needed in order
        !           705: to install a specific target, but which are not explicitly specified in the
        !           706: .Pa distfile .
        !           707: .It Sy nerror
        !           708: Normal errors that are not fatal.
        !           709: .It Sy ferror
        !           710: Fatal errors.
        !           711: .It Sy warning
        !           712: Warnings about errors which are not as serious as
        !           713: .Sy nerror
        !           714: type messages.
        !           715: .It Sy debug
        !           716: Debugging information.
        !           717: .It Sy all
        !           718: All but debug messages.
        !           719: .El
        !           720: .Pp
        !           721: Here is a sample command line option:
        !           722: .Bd -literal -offset indent
        !           723: -l stdout=all:syslog=change,notice:file=/tmp/rdist.log=all
        !           724: .Ed
        !           725: .Pp
        !           726: This entry will set local message logging to have all but debug
        !           727: messages sent to standard output, change and notice messages will
        !           728: be sent to
        !           729: .Xr syslog 3 ,
        !           730: and all messages will be written to the file
        !           731: .Pa /tmp/rdist.log .
        !           732: .Sh ENVIRONMENT
        !           733: .Bl -tag -width "TMPDIR"
        !           734: .It TMPDIR
        !           735: Name of temporary directory to use.
        !           736: Default is
        !           737: .Pa /tmp .
        !           738: .It RSH
        !           739: Name of the default remote shell program to use.
        !           740: Default is
        !           741: .Xr ssh 1 .
        !           742: .El
        !           743: .Sh FILES
        !           744: .Bl -tag -width "$TMPDIR/rdist*" -compact
        !           745: .It distfile
        !           746: input command file
        !           747: .It $TMPDIR/rdist*
        !           748: temporary file for update lists
        !           749: .El
        !           750: .Sh EXAMPLES
1.14      millert   751: .Bd -literal -offset indent
1.2       dm        752: HOSTS = ( matisse root@arpa)
1.1       deraadt   753:
                    754: FILES = ( /bin /lib /usr/bin /usr/games
1.2       dm        755:        /usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}
                    756:        /usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )
1.1       deraadt   757:
1.14      millert   758: EXLIB = ( Mail.rc aliases aliases.db crontab dshrc
                    759:        sendmail.cf sendmail.hf sendmail.st uucp vfont )
1.1       deraadt   760:
                    761: ${FILES} -> ${HOSTS}
1.2       dm        762:        install -oremove,chknfs ;
                    763:        except /usr/lib/${EXLIB} ;
                    764:        except /usr/games/lib ;
1.14      millert   765:        special /usr/lib/sendmail "/usr/lib/sendmail -bi" ;
1.1       deraadt   766:
                    767: srcs:
                    768: /usr/src/bin -> arpa
1.2       dm        769:        except_pat ( \e\e.o\e$ /SCCS\e$ ) ;
1.1       deraadt   770:
                    771: IMAGEN = (ips dviimp catdvi)
                    772:
                    773: imagen:
                    774: /usr/local/${IMAGEN} -> arpa
1.2       dm        775:        install /usr/local/lib ;
                    776:        notify ralph ;
1.1       deraadt   777:
                    778: ${FILES} :: stamp.cory
1.2       dm        779:        notify root@cory ;
1.14      millert   780: .Ed
                    781: .Sh SEE ALSO
                    782: .Xr csh 1 ,
                    783: .Xr rsh 1 ,
1.19      jmc       784: .Xr sh 1 ,
1.14      millert   785: .Xr ssh 1 ,
                    786: .Xr stat 2 ,
                    787: .Xr rcmdsh 3
1.23    ! jmc       788: .Sh STANDARDS
        !           789: The options
        !           790: .Op Fl bhiNOqRrsvwxy
        !           791: are still recognized for backwards compatibility.
        !           792: .Sh CAVEATS
1.14      millert   793: If the basename of a file  (the last component in the pathname) is ".", then
                    794: .Nm
1.2       dm        795: assumes the remote (destination) name is a directory.
1.11      aaron     796: i.e.,
1.14      millert   797: .Pa /tmp/ .
1.2       dm        798: means that
1.14      millert   799: .Pa /tmp
1.2       dm        800: should be a directory on the remote host.
1.14      millert   801: .Sh BUGS
1.2       dm        802: Source files must reside on the local host where rdist is executed.
1.14      millert   803: .Pp
1.1       deraadt   804: Variable expansion only works for name lists; there should be a general macro
                    805: facility.
1.14      millert   806: .Pp
                    807: .Nm
1.1       deraadt   808: aborts on files which have a negative mtime (before Jan 1, 1970).
1.14      millert   809: .Pp
1.2       dm        810: If a hardlinked file is listed more than once in the same target,
1.8       aaron     811: then
1.14      millert   812: .Nm
1.2       dm        813: will report missing links.
                    814: Only one instance of a link should be listed in each target.
1.17      millert   815: .Pp
1.19      jmc       816: The
                    817: .Sy defowner ,
                    818: .Sy defgroup ,
1.17      millert   819: and
                    820: .Sy updateperm
                    821: options are extensions to the 6.1.0 protocol and will not work with earlier
                    822: versions of rdist 6.