|
|
1.1 ! root 1: .\" Copyright (c) 1985, 1990 The Regents of the University of California. ! 2: .\" All rights reserved. ! 3: .\" ! 4: .\" Redistribution and use in source and binary forms are permitted provided ! 5: .\" that: (1) source distributions retain this entire copyright notice and ! 6: .\" comment, and (2) distributions including binaries display the following ! 7: .\" acknowledgement: ``This product includes software developed by the ! 8: .\" University of California, Berkeley and its contributors'' in the ! 9: .\" documentation or other materials provided with the distribution and in ! 10: .\" all advertising materials mentioning features or use of this software. ! 11: .\" Neither the name of the University nor the names of its contributors may ! 12: .\" be used to endorse or promote products derived from this software without ! 13: .\" specific prior written permission. ! 14: .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED ! 15: .\" WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF ! 16: .\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ! 17: .\" ! 18: .\" @(#)rdist.1 6.9 (Berkeley) 7/24/90 ! 19: .\" ! 20: .Dd July 24, 1990 ! 21: .Dt RDIST 1 ! 22: .Os BSD 4.3 ! 23: .Sh NAME ! 24: .Nm rdist ! 25: .Nd remote file distribution program ! 26: .Sh SYNOPSIS ! 27: .Nm rdist ! 28: .Op Fl nqbRhivwy ! 29: .Op Fl f Ar distfile ! 30: .Op Fl d Ar var=value ! 31: .Op Fl m host ! 32: .Op Ar name ... ! 33: .Pp ! 34: .Nm rdist ! 35: .Op Fl nqbRhivwy ! 36: .Fl c ! 37: .Ar name ... ! 38: .Cx Op login@ ! 39: .Ar host ! 40: .Op :dest ! 41: .Cx ! 42: .Sh DESCRIPTION ! 43: .Nm Rdist ! 44: is a program to maintain identical copies of files over multiple hosts. ! 45: It preserves the owner, group, mode, and mtime of files if possible and ! 46: can update programs that are executing. ! 47: .Nm Rdist ! 48: reads commands from ! 49: .Ar distfile ! 50: to direct the updating of files and/or directories. ! 51: .Pp ! 52: Options specific to the first SYNOPSIS form: ! 53: .Pp ! 54: .Tw Fl ! 55: .Tp Fl ! 56: If ! 57: .Ar distfile ! 58: is ! 59: .Sq Fl , ! 60: the standard input is used. ! 61: .Tp Cx Fl f ! 62: .Cx \&\ \& ! 63: .Ar distfile ! 64: .Cx ! 65: Use the specified ! 66: .Ar distfile. ! 67: .Tp ! 68: .Pp ! 69: If either the ! 70: .Fl f ! 71: or ! 72: .Sq Fl ! 73: option is not specified, the program looks first for ! 74: .Dq Pa distfile , ! 75: then ! 76: .Dq Pa Distfile ! 77: to use as the input. ! 78: If no names are specified on the command line, ! 79: .Nm rdist ! 80: will update all of the files and directories listed in ! 81: .Ar distfile . ! 82: Otherwise, the argument is taken to be the name of a file to be updated ! 83: or the label of a command to execute. If label and file names conflict, ! 84: it is assumed to be a label. ! 85: These may be used together to update specific files ! 86: using specific commands. ! 87: .Pp ! 88: Options specific to the second SYNOPSIS form: ! 89: .Pp ! 90: .Tp Fl c ! 91: Forces ! 92: .Nm rdist ! 93: to interpret the remaining arguments as a small ! 94: .Ar distfile . ! 95: .Pp ! 96: The equivalent distfile is as follows. ! 97: .Pp ! 98: .Df I ! 99: .Pq Ar name ... ! 100: .Li -> ! 101: .Op Ar login@ ! 102: .Ar host ! 103: .Df I ! 104: .Li install ! 105: .Op Ar dest ; ! 106: .De ! 107: .De ! 108: .Tp ! 109: .Pp ! 110: Options common to both forms: ! 111: .Pp ! 112: .Tw Ic ! 113: .Tp Cx Fl d ! 114: .Cx \&\ \& ! 115: .Ar var=value ! 116: .Cx ! 117: Define ! 118: .Ar var ! 119: to have ! 120: .Ar value . ! 121: The ! 122: .Fl d ! 123: option is used to define or override variable definitions in the ! 124: .Ar distfile . ! 125: .Ar Value ! 126: can be the empty string, one name, or a list of names surrounded by ! 127: parentheses and separated by tabs and/or spaces. ! 128: .Tp Cx Fl m ! 129: .Cx \&\ \& ! 130: .Ar host ! 131: .Cx ! 132: Limit which machines are to be updated. Multiple ! 133: .Fl m ! 134: arguments can be given to limit updates to a subset of the hosts listed the ! 135: .Ar distfile . ! 136: .Tp Fl n ! 137: Print the commands without executing them. This option is ! 138: useful for debugging ! 139: .Ar distfile . ! 140: .Tp Fl q ! 141: Quiet mode. Files that are being modified are normally ! 142: printed on standard output. The ! 143: .Fl q ! 144: option suppresses this. ! 145: .Tp Fl R ! 146: Remove extraneous files. If a directory is being updated, any files that exist ! 147: on the remote host that do not exist in the master directory are removed. ! 148: This is useful for maintaining truely identical copies of directories. ! 149: .Tp Fl h ! 150: Follow symbolic links. Copy the file that the link points to rather than the ! 151: link itself. ! 152: .Tp Fl i ! 153: Ignore unresolved links. ! 154: .Nm Rdist ! 155: will normally try to maintain the link structure of files being transfered ! 156: and warn the user if all the links cannot be found. ! 157: .Tp Fl v ! 158: Verify that the files are up to date on all the hosts. Any files ! 159: that are out of date will be displayed but no files will be changed ! 160: nor any mail sent. ! 161: .Tp Fl w ! 162: Whole mode. The whole file name is appended to the destination directory ! 163: name. Normally, only the last component of a name is used when renaming files. ! 164: This will preserve the directory structure of the files being ! 165: copied instead of flattening the directory structure. For example, ! 166: renaming a list of files such as ( dir1/f1 dir2/f2 ) to dir3 would create ! 167: files dir3/dir1/f1 and dir3/dir2/f2 instead of dir3/f1 and dir3/f2. ! 168: .Tp Fl y ! 169: Younger mode. Files are normally updated if their ! 170: .Ar mtime ! 171: and ! 172: .Ar size ! 173: (see ! 174: .Xr stat 2 ) ! 175: disagree. The ! 176: .Fl y ! 177: option causes ! 178: .Nm rdist ! 179: not to update files that are younger than the master copy. ! 180: This can be used ! 181: to prevent newer copies on other hosts from being replaced. ! 182: A warning message is printed for files which are newer than the master copy. ! 183: .Tp Fl b ! 184: Binary comparison. Perform a binary comparison and update files if they differ ! 185: rather than comparing dates and sizes. ! 186: .Tp ! 187: .Pp ! 188: .Ar Distfile ! 189: contains a sequence of entries that specify the files ! 190: to be copied, the destination hosts, and what operations to perform ! 191: to do the updating. Each entry has one of the following formats. ! 192: .Pp ! 193: .Ds I ! 194: <variable name> `=' <name list> ! 195: [label:]<source list> `\->' <destination list> <command list> ! 196: [label:]<source list> `::' <time_stamp file> <command list> ! 197: .De ! 198: .Pp ! 199: The first format is used for defining variables. ! 200: The second format is used for distributing files to other hosts. ! 201: The third format is used for making lists of files that have been changed ! 202: since some given date. ! 203: The ! 204: .Ar source list ! 205: specifies a ! 206: list of files and/or directories on the local host which are to be used ! 207: as the master copy for distribution. ! 208: The ! 209: .Ar destination list ! 210: is the list of hosts to which these files are to be ! 211: copied. Each file in the source list is added to a list of changes ! 212: if the file is out of date on the host which is being updated (second format) or ! 213: the file is newer than the time stamp file (third format). ! 214: .Pp ! 215: Labels are optional. They are used to identify a command for partial updates. ! 216: .Pp ! 217: Newlines, tabs, and blanks are only used as separators and are ! 218: otherwise ignored. Comments begin with `#' and end with a newline. ! 219: .Pp ! 220: Variables to be expanded begin with `$' followed by one character or ! 221: a name enclosed in curly braces (see the examples at the end). ! 222: .Pp ! 223: The source and destination lists have the following format: ! 224: .Pp ! 225: .Ds I ! 226: <name> ! 227: .De ! 228: or ! 229: .Ds I ! 230: `(' <zero or more names separated by white-space> `)' ! 231: .De ! 232: .Pp ! 233: The shell meta-characters `[', `]', `{', `}', `*', and `?' ! 234: are recognized and expanded (on the local host only) in the same way as ! 235: .Xr csh 1 . ! 236: They can be escaped with a backslash. ! 237: The `~' character is also expanded in the same way as ! 238: .Xr csh 1 ! 239: but is expanded separately on the local and destination hosts. ! 240: When the ! 241: .Fl w ! 242: option is used with a file name that begins with `~', everything except the ! 243: home directory is appended to the destination name. ! 244: File names which do not begin with `/' or `~' use the destination user's ! 245: home directory as the root directory for the rest of the file name. ! 246: .Pp ! 247: The command list consists of zero or more commands of the following ! 248: format. ! 249: .Ds I ! 250: .Cw except_patx pattern\ listx ! 251: .Cl `install' <options> opt_dest_name `;' ! 252: .Cl `notify' <name list> `;' ! 253: .Cl `except' <name list> `;' ! 254: .Cl `except_pat' <pattern list> `;' ! 255: .Cl `special' <name list> string `;' ! 256: .Cw ! 257: .De ! 258: .Pp ! 259: The ! 260: .Ic install ! 261: command is used to copy out of date files and/or directories. ! 262: Each source file is copied to each host in the destination list. ! 263: Directories are recursively copied in the same way. ! 264: .Ar Opt_dest_name ! 265: is an optional parameter to rename files. ! 266: If no ! 267: .Ic install ! 268: command appears in the command list or ! 269: the destination name is not specified, ! 270: the source file name is used. ! 271: Directories in the path name will be created if they ! 272: do not exist on the remote host. ! 273: To help prevent disasters, a non-empty directory on a target host will ! 274: never be replaced with a regular file or a symbolic link. ! 275: However, under the `\-R' option a non-empty directory will be removed ! 276: if the corresponding filename is completely absent on the master host. ! 277: The ! 278: .Ar options ! 279: are `\-R', `\-h', `\-i', `\-v', `\-w', `\-y', and `\-b' ! 280: and have the same semantics as ! 281: options on the command line except they only apply to the files ! 282: in the source list. ! 283: The login name used on the destination host is the same as the local host ! 284: unless the destination name is of the format ``login@host". ! 285: .Pp ! 286: The ! 287: .Ic notify ! 288: command is used to mail the list of files updated (and any errors ! 289: that may have occured) to the listed names. ! 290: If no `@' appears in the name, the destination host is appended to ! 291: the name ! 292: (e.g., name1@host, name2@host, ...). ! 293: .Pp ! 294: The ! 295: .Ic except ! 296: command is used to update all of the files in the source list ! 297: .Ic except ! 298: for the files listed in ! 299: .Ar name list . ! 300: This is usually used to copy everything in a directory except certain files. ! 301: .Pp ! 302: The ! 303: .Ic except_pat ! 304: command is like the ! 305: .Ic except ! 306: command except that ! 307: .Ar pattern list ! 308: is a list of regular expressions ! 309: (see ! 310: .Xr ed 1 ! 311: for details). ! 312: If one of the patterns matches some string within a file name, that file will ! 313: be ignored. ! 314: Note that since `\e' is a quote character, it must be doubled to become ! 315: part of the regular expression. Variables are expanded in ! 316: .Ar pattern list ! 317: but not shell file pattern matching characters. To include a `$', it ! 318: must be escaped with `\e'. ! 319: .Pp ! 320: The ! 321: .Ic special ! 322: command is used to specify ! 323: .Xr sh 1 ! 324: commands that are to be executed on the ! 325: remote host after the file in ! 326: .Ar name list ! 327: is updated or installed. ! 328: If the ! 329: .Ar name list ! 330: is omitted then the shell commands will be executed ! 331: for every file updated or installed. The shell variable `FILE' is set ! 332: to the current filename before executing the commands in ! 333: .Ar string . ! 334: .Ar String ! 335: starts and ends with `"' and can cross multiple lines in ! 336: .Ar distfile . ! 337: Multiple commands to the shell should be separated by `;'. ! 338: Commands are executed in the user's home directory on the host ! 339: being updated. ! 340: The ! 341: .Ar special ! 342: command can be used to rebuild private databases, etc. ! 343: after a program has been updated. ! 344: .Pp ! 345: The following is a small example: ! 346: .Pp ! 347: .Ds I ! 348: HOSTS = ( matisse root@arpa ) ! 349: .sp ! 350: FILES = ( /bin /lib /usr/bin /usr/games ! 351: \t/usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h} ! 352: \t/usr/lib /usr/man/man? /usr/ucb /usr/local/rdist ) ! 353: .sp ! 354: EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc ! 355: \tsendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont ) ! 356: .sp ! 357: ${FILES} -> ${HOSTS} ! 358: \tinstall -R ; ! 359: \texcept /usr/lib/${EXLIB} ; ! 360: \texcept /usr/games/lib ; ! 361: \tspecial /usr/lib/sendmail "/usr/lib/sendmail -bz" ; ! 362: .sp ! 363: srcs: ! 364: /usr/src/bin -> arpa ! 365: \texcept_pat ( \e\e.o\e$ /SCCS\e$ ) ; ! 366: .sp ! 367: IMAGEN = (ips dviimp catdvi) ! 368: .sp ! 369: imagen: ! 370: /usr/local/${IMAGEN} -> arpa ! 371: \tinstall /usr/local/lib ; ! 372: \tnotify ralph ; ! 373: .sp ! 374: ${FILES} :: stamp.cory ! 375: \tnotify root@cory ; ! 376: .De ! 377: .Sh FILES ! 378: .Dw /tmp/rdist* ! 379: .Di L ! 380: .Dp Pa distfile ! 381: input command file ! 382: .Dp Pa /tmp/rdist* ! 383: temporary file for update lists ! 384: .Dp ! 385: .Sh SEE ALSO ! 386: .Xr sh 1 , ! 387: .Xr csh 1 , ! 388: .Xr stat 2 ! 389: .Sh HISTORY ! 390: The ! 391: .Nm ! 392: command appeared in 4.3 BSD. ! 393: .Sh DIAGNOSTICS ! 394: A complaint about mismatch of rdist version numbers may really stem ! 395: from some problem with starting your shell, e.g., you are in too many groups. ! 396: .Sh BUGS ! 397: Source files must reside on the local host where ! 398: .Nm rdist ! 399: is executed. ! 400: .Pp ! 401: There is no easy way to have a special command executed after all files ! 402: in a directory have been updated. ! 403: .Pp ! 404: Variable expansion only works for name lists; there should be a general macro ! 405: facility. ! 406: .Pp ! 407: .Nm Rdist ! 408: aborts on files which have a negative mtime (before Jan 1, 1970). ! 409: .Pp ! 410: There should be a `force' option to allow replacement of non-empty directories ! 411: by regular files or symlinks. A means of updating file modes and owners ! 412: of otherwise identical files is also needed.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.