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

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