Annotation of src/usr.bin/rdist/rdist.1, Revision 1.26
1.26 ! jmc 1: .\" $OpenBSD: rdist.1,v 1.25 2007/02/26 16:39:23 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
1.25 jmc 80: .Pa Distfile ,
1.14 millert 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.25 jmc 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.25 jmc 101: .Dq localhost
1.14 millert 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.25 jmc 113: ssh \*(Lthost\*(Gt -l \*(Ltlogin_name\*(Gt rdistd -S
1.14 millert 114: .Ed
115: .Pp
1.25 jmc 116: .Ar host
117: is the name of the target host;
118: .Ar login_name
119: is the name of the user to make the connection as.
1.14 millert 120: .Pp
1.2 dm 121: On each target host
1.14 millert 122: .Nm
1.25 jmc 123: will attempt to run the command:
1.14 millert 124: .Bd -literal -offset indent
125: rdistd -S
126: .Ed
1.25 jmc 127: .Pp
128: Or if the
129: .Fl p
130: option was specified,
131: .Nm
132: will attempt to run the command:
133: .Bd -literal -offset indent
1.24 jmc 134: \*(Ltrdistd path\*(Gt -S
1.14 millert 135: .Ed
136: .Pp
1.2 dm 137: If no
1.14 millert 138: .Fl p
1.25 jmc 139: option is specified, or
1.24 jmc 140: .Aq Ar rdistd path
1.2 dm 141: is a simple filename,
1.24 jmc 142: .Xr rdistd 1
1.2 dm 143: or
1.24 jmc 144: .Aq Ar rdistd path
1.8 aaron 145: must be somewhere in the
1.14 millert 146: .Ev PATH
1.2 dm 147: of the user running
1.14 millert 148: .Nm
1.2 dm 149: on the remote (target) host.
1.14 millert 150: .Pp
151: The options are as follows:
152: .Bl -tag -width Ds
153: .It Fl A Ar num
1.2 dm 154: Set the minimum number of free files (inodes) on a filesystem that must exist
1.8 aaron 155: for
1.14 millert 156: .Nm
1.2 dm 157: to update or install a file.
1.14 millert 158: .It Fl a Ar num
1.2 dm 159: Set the minimum amount of free space (in bytes) on a filesystem that must exist
1.8 aaron 160: for
1.14 millert 161: .Nm
1.2 dm 162: to update or install a file.
1.22 jmc 163: .It Fl c Ar mini_distfile
164: Forces
165: .Nm
166: to interpret the remaining arguments as a small
167: .Pa distfile .
168: The equivalent distfile is as follows.
169: .Bd -literal -offset indent
1.24 jmc 170: ( name ... ) -\*(Gt [login@]host
171: install [dest] ;
1.22 jmc 172: .Ed
1.14 millert 173: .It Fl D
1.2 dm 174: Enable copious debugging messages.
1.22 jmc 175: .It Xo
176: .Fl d Ar var Ns = Ns Ar value
177: .Xc
1.1 deraadt 178: Define
1.14 millert 179: .Ar var
1.1 deraadt 180: to have
1.14 millert 181: .Ar value .
1.2 dm 182: This
1.26 ! jmc 183: option is used to define or override variable definitions in
1.14 millert 184: .Pa distfile .
185: .Ar value
1.1 deraadt 186: can be the empty string, one name, or a list of names surrounded by
187: parentheses and separated by tabs and/or spaces.
1.14 millert 188: .It Fl F
1.8 aaron 189: Do not fork any child
1.14 millert 190: .Nm
1.2 dm 191: processes.
192: All clients are updated sequentially.
1.14 millert 193: .It Fl f Ar distfile
1.26 ! jmc 194: Set the name of the distfile to
1.14 millert 195: .Ar distfile .
1.8 aaron 196: If
1.26 ! jmc 197: .Sq -
! 198: (dash) is used then read from standard input (stdin).
1.22 jmc 199: .It Fl L Ar remote_logopts
200: Set remote logging options.
1.8 aaron 201: See the section
1.26 ! jmc 202: .Sx MESSAGE LOGGING
1.2 dm 203: for details on the syntax for
1.26 ! jmc 204: .Ar remote_logopts .
1.22 jmc 205: .It Fl l Ar local_logopts
206: Set local logging options.
1.8 aaron 207: See the section
1.26 ! jmc 208: .Sx MESSAGE LOGGING
1.2 dm 209: for details on the syntax for
1.26 ! jmc 210: .Ar local_logopts .
1.22 jmc 211: .It Fl M Ar maxproc
1.14 millert 212: Set the maximum number of simultaneously running child
213: .Nm
1.2 dm 214: processes to
1.22 jmc 215: .Ar maxproc .
1.2 dm 216: The default is 4.
1.22 jmc 217: .It Fl m Ar host
1.19 jmc 218: Limit which machines are to be updated.
219: Multiple
1.14 millert 220: .Fl m
1.26 ! jmc 221: arguments can be given to limit updates to a subset of the hosts listed in
1.14 millert 222: .Pa distfile .
223: .It Fl n
224: Print the commands without executing them.
1.26 ! jmc 225: This option is useful for debugging a distfile.
1.22 jmc 226: .It Fl o Ar distopts
1.2 dm 227: Specify the dist options to enable.
1.14 millert 228: .Ar distopts
1.2 dm 229: is a comma separated list of options which are listed below.
230: The valid values for
1.14 millert 231: .Ar distopts
1.2 dm 232: are:
1.14 millert 233: .Bl -tag -width Ds
1.22 jmc 234: .It Ic chknfs
1.26 ! jmc 235: Do not check or update files on the target host
! 236: that reside on NFS filesystems.
1.22 jmc 237: .It Ic chkreadonly
1.26 ! jmc 238: Enable a check on the target host
! 239: to see if a file resides on a read-only filesystem.
1.2 dm 240: If a file does, then no checking or updating of the file is attempted.
1.22 jmc 241: .It Ic chksym
1.2 dm 242: If the target on the remote host is a symbolic link, but is not on the
243: master host, the remote target will be left a symbolic link.
244: This behavior is generally considered a bug in the original version of
1.14 millert 245: .Nm rdist ,
1.2 dm 246: but is present to allow compatibility with older versions.
1.22 jmc 247: .It Ic compare
248: Binary comparison.
249: Perform a binary comparison and update files if they differ rather than
250: comparing dates and sizes.
251: .It Ic defgroup Ns Op = Ns Ic groupname
1.17 millert 252: If the group of a file to be transferred does not exist on the destination
253: host, use the specified group instead.
254: If groupname is not specified, the
255: .Em bin
256: group is used.
1.22 jmc 257: .It Ic defowner Ns Op = Ns Ic owner
1.17 millert 258: If the owner of a file to be transferred does not exist on the destination
259: host, use the specified owner instead.
260: If owner is not specified, the user
261: .Em bin
262: is used.
1.22 jmc 263: .It Ic follow
264: Follow symbolic links.
265: Copy the file that the link points to rather than the link itself.
266: .It Ic history
267: When
268: .Ic savetargets
269: and
270: .Ic history
271: are both defined then the target file that is updated is first renamed from
272: .Pa file
273: to
274: .Pa file.NNN
275: where NNN increases for each generation update.
276: The first generation is 001, and the last is 999.
277: After 999 generations, the counter is reset to 001 and 001 will get
278: overwritten all the time.
279: This is undesirable behavior, so some other method needs to be devised
280: to clean up or limit the number of generations.
281: .It Ic ignlnks
282: Ignore unresolved links.
283: .Nm
284: will normally try to maintain the link structure of files being transferred
285: and warn the user if all the links cannot be found.
286: .It Ic nochkgroup
1.2 dm 287: Do not check group ownership of files that already exist.
288: The file ownership is only set when the file is updated.
1.22 jmc 289: .It Ic nochkmode
1.2 dm 290: Do not check file and directory permission modes.
291: The permission mode is only set when the file is updated.
1.22 jmc 292: .It Ic nochkowner
293: Do not check user ownership of files that already exist.
294: The file ownership is only set when the file is updated.
295: .It Ic nodescend
1.2 dm 296: Do not descend into a directory.
1.14 millert 297: Normally,
298: .Nm
1.2 dm 299: will recursively check directories.
1.14 millert 300: If this option is enabled, then any files listed in the file list in the
301: distfile that are directories are not recursively scanned.
1.2 dm 302: Only the existence, ownership, and mode of the directory are checked.
1.22 jmc 303: .It Ic noexec
304: Automatically exclude executable files that are in
305: .Xr a.out 5
306: format from being checked or updated.
307: .It Ic numchkgroup
1.9 aaron 308: Use the numeric group ID (GID) to check group ownership instead of
1.2 dm 309: the group name.
1.22 jmc 310: .It Ic numchkowner
1.9 aaron 311: Use the numeric user ID (UID) to check user ownership instead of
1.2 dm 312: the user name.
1.22 jmc 313: .It Ic quiet
314: Quiet mode.
315: Files that are being modified are normally printed on standard output.
316: This option suppresses that.
317: .It Ic remove
318: Remove extraneous files.
319: If a directory is being updated, any files that exist on the remote host
320: that do not exist in the master directory are removed.
321: This is useful for maintaining truly identical copies of directories.
322: .It Ic savetargets
1.2 dm 323: Save files that are updated instead of removing them.
1.15 deraadt 324: Any target file that is updated is first renamed from
1.14 millert 325: .Pa file
1.2 dm 326: to
1.14 millert 327: .Pa file.OLD .
1.22 jmc 328: .It Ic sparse
1.14 millert 329: Enable checking for sparse (aka
330: .Dq wholely )
331: files.
332: One of the most common types of sparse files are those produced by
333: .Xr db 3 .
1.3 dm 334: This option adds some additional processing overhead so it should
335: only be enabled for targets likely to contain sparse files.
1.22 jmc 336: .It Ic updateperm
337: Do not send the whole file when the size and the modification time match.
338: Instead, just update the ownership, group, and permissions as necessary.
339: .It Ic verify
340: Verify that the files are up to date on all the hosts.
1.26 ! jmc 341: Any files that are out of date will be displayed
! 342: but no files will be changed and no mail will be sent.
1.22 jmc 343: .It Ic whole
344: Whole mode.
345: The whole file name is appended to the destination directory name.
346: Normally, only the last component of a name is used when renaming files.
347: This will preserve the directory structure of the files being
348: copied instead of flattening the directory structure.
349: For example, rdisting a list of files such as
1.26 ! jmc 350: .Pa /p/dir1/f1
1.22 jmc 351: and
1.26 ! jmc 352: .Pa /p/dir2/f2
1.22 jmc 353: to
354: .Pa /tmp/dir
355: would create files
1.26 ! jmc 356: .Pa /tmp/dir/p/dir1/f1
1.22 jmc 357: and
1.26 ! jmc 358: .Pa /tmp/dir/p/dir2/f2
1.22 jmc 359: instead of
360: .Pa /tmp/dir/dir1/f1
361: and
362: .Pa /tmp/dir/dir2/f2 .
363: .It Ic younger
364: Younger mode.
365: Files are normally updated if their
366: .Em mtime
367: and
368: .Em size
369: (see
370: .Xr stat 2 )
371: disagree.
372: This option causes
373: .Nm
374: not to update files that are younger than the master copy.
375: This can be used to prevent newer copies on other hosts from being replaced.
376: A warning message is printed for files which are newer than the master copy.
1.14 millert 377: .El
1.22 jmc 378: .It Fl P Ar rsh-path
1.14 millert 379: Set the path to the remote shell command.
1.21 jmc 380: .Ar rsh-path
1.7 deraadt 381: may be a colon separated list of possible pathnames.
1.2 dm 382: In this case, the first component of the path to exist is used.
1.24 jmc 383: For example,
1.26 ! jmc 384: .Pa /usr/bin/ssh:/usr/bin/rsh
! 385: or
1.14 millert 386: .Pa /usr/bin/ssh .
1.22 jmc 387: .It Fl p Ar rdistd-path
388: Set the path where the rdistd server is searched for on the target host.
389: .It Fl Server
390: This option is recognized to provide partial backward compatible support
391: for older versions of
392: .Nm
393: which used this option to put
394: .Nm
395: into server mode.
396: If
397: .Nm
398: is started with the
399: .Fl Server
400: command line option, it will attempt to exec (run) the old version of
401: .Nm rdist ,
402: .Pa /usr/bin/oldrdist .
1.14 millert 403: .It Fl t Ar timeout
1.26 ! jmc 404: Set the timeout period,
! 405: in seconds,
! 406: for waiting for responses from the remote
1.14 millert 407: .Nm
1.2 dm 408: server.
409: The default is 900 seconds.
1.14 millert 410: .It Fl V
1.2 dm 411: Print version information and exit.
1.16 jmc 412: .El
1.14 millert 413: .Sh DISTFILES
1.2 dm 414: The
1.14 millert 415: .Pa distfile
1.1 deraadt 416: contains a sequence of entries that specify the files
417: to be copied, the destination hosts, and what operations to perform
1.19 jmc 418: to do the updating.
419: Each entry has one of the following formats.
1.14 millert 420: .Bd -literal -offset indent
1.24 jmc 421: \*(Ltvariable name\*(Gt `=' \*(Ltname list\*(Gt
422: [ label: ] \*(Ltsource list\*(Gt `\-\*(Gt' \*(Ltdestination list\*(Gt \*(Ltcommand list\*(Gt
423: [ label: ] \*(Ltsource list\*(Gt `::' \*(Lttime_stamp file\*(Gt \*(Ltcommand list\*(Gt
1.14 millert 424: .Ed
425: .Pp
1.1 deraadt 426: The first format is used for defining variables.
427: The second format is used for distributing files to other hosts.
428: The third format is used for making lists of files that have been changed
429: since some given date.
1.14 millert 430: The
431: .Em source list
432: specifies a list of files and/or directories on the local host which are to
433: be used as the master copy for distribution.
434: The
435: .Em destination list
436: is the list of hosts to which these files are to be copied.
437: Each file in the source list is added to a list of changes if the file
438: is out of date on the host which is being updated (second format) or
1.1 deraadt 439: the file is newer than the time stamp file (third format).
1.14 millert 440: .Pp
441: Labels are optional.
442: They are used to identify a command for partial updates.
443: .Pp
1.1 deraadt 444: Newlines, tabs, and blanks are only used as separators and are
1.14 millert 445: otherwise ignored.
446: Comments begin with
447: .Sq #
448: and end with a newline.
449: .Pp
450: Variables to be expanded begin with
451: .Sq $
452: followed by one character or a name enclosed in curly braces
453: (see the examples at the end).
454: .Pp
1.1 deraadt 455: The source and destination lists have the following format:
1.14 millert 456: .Bd -literal -offset indent
1.24 jmc 457: \*(Ltname\*(Gt
1.14 millert 458: .Ed
1.1 deraadt 459: or
1.14 millert 460: .Bd -literal -compact -offset indent
1.24 jmc 461: `(' \*(Ltzero or more names separated by whitespace\*(Gt `)'
1.14 millert 462: .Ed
463: .Pp
1.2 dm 464: These simple lists can be modified by using one level of set addition,
465: subtraction, or intersection like this:
1.14 millert 466: .Bd -literal -offset indent
1.2 dm 467: list '-' list
1.14 millert 468: .Ed
1.2 dm 469: or
1.14 millert 470: .Bd -literal -compact -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
477: .Pp
1.24 jmc 478: If additional modifications are needed (e.g.\&
1.14 millert 479: .Do
480: all servers and client machines except for the OSF/1 machines
481: .Dc )
482: then the list will have to be explicitly constructed in steps using
483: .Dq temporary
484: variables.
485: .Pp
1.1 deraadt 486: The shell meta-characters `[', `]', `{', `}', `*', and `?'
487: are recognized and expanded (on the local host only) in the same way as
1.14 millert 488: .Xr csh 1 .
1.1 deraadt 489: They can be escaped with a backslash.
490: The `~' character is also expanded in the same way as
1.14 millert 491: .Xr csh 1
1.1 deraadt 492: but is expanded separately on the local and destination hosts.
493: When the
1.14 millert 494: .Fl o Ns Ar whole
1.1 deraadt 495: option is used with a file name that begins with `~', everything except the
496: home directory is appended to the destination name.
497: File names which do not begin with `/' or `~' use the destination user's
498: home directory as the root directory for the rest of the file name.
1.14 millert 499: .Pp
1.1 deraadt 500: The command list consists of zero or more commands of the following
501: format.
1.24 jmc 502: .Bl -column "except_pat" "pattern listXX" "opt_dest_name" ";" -offset indent
503: .\" .It `install' Ta \*(Ltoptions\*(Gt Ta opt_dest_name Ta `;'
504: .\" .It `notify' Ta \*(Ltname list\*(Gt Ta "" Ta `;'
505: .\" .It `except' Ta \*(Ltname list\*(Gt Ta "" Ta `;'
506: .\" .It `except_pat' Ta \*(Ltpattern list\*(Gt Ta "" Ta `;'
507: .\" .It `special' Ta \*(Ltname list\*(Gt Ta string Ta `;'
508: .\" .It `cmdspecial' Ta \*(Ltname list\*(Gt Ta string Ta `;'
1.14 millert 509: .El
510: .Pp
1.1 deraadt 511: The
1.14 millert 512: .Em install
1.1 deraadt 513: command is used to copy out of date files and/or directories.
514: Each source file is copied to each host in the destination list.
515: Directories are recursively copied in the same way.
1.14 millert 516: .Em opt_dest_name
1.1 deraadt 517: is an optional parameter to rename files.
518: If no
1.14 millert 519: .Em install
520: command appears in the command list or the destination name is not specified,
1.1 deraadt 521: the source file name is used.
522: Directories in the path name will be created if they
523: do not exist on the remote host.
1.2 dm 524: The
1.14 millert 525: .Fl o Ns Ar distopts
526: option as specified above has the same semantics as
527: on the command line except
528: .Ar distopts
529: only apply to the files in the source list.
1.1 deraadt 530: The login name used on the destination host is the same as the local host
1.14 millert 531: unless the destination name is of the format
532: .Dq login@host .
533: .Pp
1.1 deraadt 534: The
1.14 millert 535: .Em notify
1.1 deraadt 536: command is used to mail the list of files updated (and any errors
537: that may have occurred) to the listed names.
538: If no `@' appears in the name, the destination host is appended to
539: the name
1.24 jmc 540: (e.g. name1@host, name2@host, ...).
1.14 millert 541: .Pp
1.1 deraadt 542: The
1.14 millert 543: .Em except
1.1 deraadt 544: command is used to update all of the files in the source list
1.14 millert 545: .Sy except
546: for the files listed in
547: .Em name list .
1.1 deraadt 548: This is usually used to copy everything in a directory except certain files.
1.14 millert 549: .Pp
1.1 deraadt 550: The
1.14 millert 551: .Em except_pat
1.1 deraadt 552: command is like the
1.14 millert 553: .Em except
554: command except that
555: .Em pattern list
556: is a list of regular expressions
1.1 deraadt 557: (see
1.14 millert 558: .Xr ed 1
1.1 deraadt 559: for details).
560: If one of the patterns matches some string within a file name, that file will
561: be ignored.
562: Note that since `\e' is a quote character, it must be doubled to become
1.14 millert 563: part of the regular expression.
564: Variables are expanded in
565: .Em pattern list
566: but not shell file pattern matching characters.
567: To include a `$', it must be escaped with `\e'.
568: .Pp
1.1 deraadt 569: The
1.14 millert 570: .Em special
1.1 deraadt 571: command is used to specify
1.14 millert 572: .Xr sh 1
573: commands that are to be executed on the remote host after the file in
574: .Em name list
575: is updated or installed.
576: If the
577: .Em name list
578: is omitted then the shell commands will be executed for every file
579: updated or installed.
580: .Em string
1.1 deraadt 581: starts and ends with `"' and can cross multiple lines in
1.19 jmc 582: .Pa distfile .
1.1 deraadt 583: Multiple commands to the shell should be separated by `;'.
584: Commands are executed in the user's home directory on the host
585: being updated.
586: The
1.14 millert 587: .Em special
1.1 deraadt 588: command can be used to rebuild private databases, etc.
589: after a program has been updated.
1.8 aaron 590: The following environment variables are set for each
1.14 millert 591: .Em special
1.2 dm 592: command:
1.14 millert 593: .Bl -tag -width "BASEFILE"
594: .It Ev FILE
1.2 dm 595: The full pathname of the local file that was just updated.
1.14 millert 596: .It Ev REMFILE
1.2 dm 597: The full pathname of the remote file that was just updated.
1.14 millert 598: .It BASEFILE
1.2 dm 599: The basename of the remote file that was just updated.
1.14 millert 600: .El
601: .Pp
1.2 dm 602: The
1.14 millert 603: .Em cmdspecial
1.2 dm 604: command is similar to the
1.14 millert 605: .Em special
1.2 dm 606: command, except it is executed only when the entire command is completed
607: instead of after each file is updated.
1.14 millert 608: The list of files is placed in the
609: .Ev FILES
610: environment variable.
1.2 dm 611: Each file name in
1.14 millert 612: .Ev FILES
1.2 dm 613: is separated by a `:' (colon).
1.14 millert 614: .Pp
615: If a hostname ends in a `+' (plus sign), then the plus
1.2 dm 616: is stripped off and NFS checks are disabled.
617: This is equivalent to disabling the
1.14 millert 618: .Fl o Ns Ar chknfs
1.2 dm 619: option just for this one host.
1.23 jmc 620: .Sh MESSAGE LOGGING
621: .Nm
622: uses a collection of predefined message
623: .Em facilities
624: that each contain a list of message
625: .Sy types
626: specifying which types of messages to send to that
627: .Em facility .
1.24 jmc 628: The local client
629: .Pq Nm rdist
630: and the remote server
631: .Pq Xr rdistd 1
632: each maintain their own copy
633: of what types of messages to log to what facilities.
1.23 jmc 634: .Pp
635: The
636: .Fl l
1.24 jmc 637: .Ar local_logopts
1.23 jmc 638: option to
639: .Nm
640: tells
641: .Nm
642: what logging options to use locally.
643: The
644: .Fl L
1.24 jmc 645: .Ar remote_logopts
1.23 jmc 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
1.24 jmc 655: should be of the form:
656: .Pp
657: .D1 facility=types:facility=types...
1.23 jmc 658: .Pp
659: The valid facility names are:
660: .Bl -tag -width Ds
1.24 jmc 661: .It Ic stdout
1.23 jmc 662: Messages to standard output.
1.24 jmc 663: .It Ic file
1.23 jmc 664: Log to a file.
665: To specify the file name, use the format
1.24 jmc 666: .Dq file=filename=types .
667: For example:
668: .Pp
669: .Dl file=/tmp/rdist.log=all,debug
670: .It Ic syslog
1.23 jmc 671: Use the
672: .Xr syslogd 8
673: facility.
1.24 jmc 674: .It Ic notify
1.23 jmc 675: Use the internal
676: .Nm
1.24 jmc 677: .Ic notify
1.23 jmc 678: facility.
679: This facility is used in conjunction with the
1.24 jmc 680: .Ic notify
1.23 jmc 681: keyword in a
682: .Pa distfile
683: to specify what messages are mailed to the
1.24 jmc 684: .Ic notify
1.23 jmc 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
1.24 jmc 697: .It Ic change
1.23 jmc 698: Things that change.
699: This includes files that are installed or updated in some way.
1.24 jmc 700: .It Ic info
1.23 jmc 701: General information.
1.24 jmc 702: .It Ic notice
1.23 jmc 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 .
1.24 jmc 707: .It Ic nerror
1.23 jmc 708: Normal errors that are not fatal.
1.24 jmc 709: .It Ic ferror
1.23 jmc 710: Fatal errors.
1.24 jmc 711: .It Ic warning
1.23 jmc 712: Warnings about errors which are not as serious as
1.24 jmc 713: .Ic nerror
1.23 jmc 714: type messages.
1.24 jmc 715: .It Ic debug
1.23 jmc 716: Debugging information.
1.24 jmc 717: .It Ic all
1.23 jmc 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:
1.24 jmc 761: ${FILES} -\*(Gt ${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:
1.24 jmc 768: /usr/src/bin -\*(Gt 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:
1.24 jmc 774: /usr/local/${IMAGEN} -\*(Gt 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.24 jmc 796: That is,
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.