rdist.1

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 1 代码 · 共 362 行

1
362
字号
.TH rdist 1.SH Namerdist \- remote file distribution program.SH Syntax.B rdist[ \fB\-nqbRhivwy\fP ][ \fB\-f\fI distfile\fP ] [ \fB\-d var\fI=value\fP ] [ \fB\-m\fI host\fP ][ .I name ... ].PP.B rdist[ \fB\-nqbRhivwy\fP ] [ \fB-c\fI name ...\fP[login@]\fIhost\fP[:dest].SH DescriptionThe.PN rdistprogram maintains identical copies of files over multiple hosts. It preserves the owner, group, mode, and mtime of files if possible andcan update programs that are executing..PN rdistreads commands from.I distfileto direct the updating of files and/or directories.If.I distfileis `\-', the standard input is used.If no.B \-foption is present, the program looks first for `distfile',then `Distfile' to use as the input.If no names are specified on the command line,.PN rdistwill update all of the files and directories listed in.IR distfile .Otherwise, the argument is taken to be the name of a file to be updatedor the label of a command to execute. If label and file names conflict,it is assumed to be a label.These may be used together to update specific filesusing specific commands..SH Options.IP \-c 5Forces.PN rdistto interpret the remaining arguments as a small.IR distfile .The equivalent .I distfile is as follows..nf.ti +.5i( \fIname\fP ... ) -> [\fIlogin\fP@]\fIhost\fP.ti +1iinstall	[\fIdest\fP] ;.fi.IP \-dDefines.B varto have.IR value .The.B \-doption is used to define or override variable definitions in the.IR distfile ..I Valuecan be the empty string, one name, or a list of names surrounded byparentheses and separated by tabs and/or spaces..IP \-mLimit which machines are to be updated. Multiple.B \-marguments can be given to limit updates to a subset of the hosts listed the.IR distfile ..IP \-nPrint the commands without executing them. This option isuseful for debugging.IR distfile ..IP \-qQuiet mode. Files that are being modified are normallyprinted on standard output. The.B \-qoption suppresses this..IP \-RRemove extraneous files. If a directory is being updated, any files that existon the remote host that do not exist in the master directory are removed.This is useful for maintaining truly identical copies of directories..IP \-hFollow symbolic links. Copy the file that the link points to rather than thelink itself..IP \-iIgnore unresolved links..I Rdistwill normally try to maintain the link structure of files beingtransferred and warn the user if all the links cannot be found..IP \-vVerify that the files are up to date on all the hosts. Any filesthat are out of date will be displayed but no files will be changednor any mail sent..IP \-wWhole mode. The whole file name is appended to the destination directoryname. Normally, only the last component of a name is used when renaming files.This will preserve the directory structure of the files beingcopied instead of flattening the directory structure. For example,renaming a list of files such as ( dir1/f1 dir2/f2 ) to dir3 would createfiles dir3/dir1/f1 and dir3/dir2/f2 instead of dir3/f1 and dir3/f2..IP \-yYounger mode. Files are normally updated if their.I mtimeand.I size(see.MS stat 2 )disagree. The.B \-yoption causes.I rdistnot to update files that are younger than the master copy.This can be usedto prevent newer copies on other hosts from being replaced.A warning message is printed for files which are newer than the master copy..IP \-bBinary comparison. Perform a binary comparison and update files if they differrather than comparing dates and sizes..PP.I Distfilecontains a sequence of entries that specify the filesto be copied, the destination hosts, and what operations to performto do the updating. Each entry has one of the following formats..nf.in +.5i<variable name> `=' <name list>[ label: ] <source list> `\->' <destination list> <command list>[ label: ] <source list> `::' <time_stamp file> <command list>.in.fiThe first format is used for defining variables.The second format is used for distributing files to other hosts.The third format is used for making lists of files that have been changedsince some given date.The \fIsource list\fP specifies alist of files and/or directories on the local host which are to be usedas the master copy for distribution.The \fIdestination list\fP is the list of hosts to which these files are to becopied.  Each file in the .I source list is added to a list of changesif the file is out of date on the host which is being updated (second format) orthe file is newer than the time stamp file (third format)..PP.I Labels are optional. They are used to identify a command for partial updates..PPNewlines, tabs, and blanks are only used as separators and areotherwise ignored. Comments begin with a sharp sign (#) and end with a newline..PPVariables to be expanded begin with dollar sign ($) followed by one character ora name enclosed in curly braces (see the examples at the end)..PPThe .I source listand .I destination list have the following format:.nf.ti +.5i<name>or.ti +.5i`(' <zero or more names separated by white-space> `)'.fiThe shell meta-characters [, ], {, }, *, and ?are recognized and expanded (on the local host only) in the same way as.PN csh .They can be escaped with a backslash (\).The tilde character (~) is also expanded in the same way as.PN csh ,but is expanded separately on the local and destination hosts.When the.B \-woption is used with a file name that begins with tilde (~), everything except thehome directory is appended to the destination name.File names which do not begin with / or ~ use the destination user'shome directory as the root directory for the rest of the file name..PPThe command list consists of zero or more commands of the followingformat..nf.in +.5i.ta \w'install    'u +\w'name list    'u`install'	<options>	opt_dest_name `;'`notify'	<name list>	`;'`except'	<name list>	`;'`except_pat'	<pattern list>	`;'`special'	<name list>	string `;'.in.fi.PPThe.I installcommand is used to copy out of date files and/or directories.Each source file is copied to each host in the destination list.Directories are recursively copied in the same way..I opt_dest_nameis an optional parameter to rename files.If no.B installcommand appears in the command list orthe destination name is not specified,the source file name is used.Directories in the path name will be created if theydo not exist on the remote host.To help prevent disasters, a non-empty directory on a target host willnever be replaced with a regular file or a symbolic link.However, under the .B \-Roption a non-empty directory will be removedif the corresponding filename is completely absent on the master host.The.I optionsare .B "\-R, \-h, \-i, \-v, \-w, \-y,"and .B \-band have the same semantics asoptions on the command line except they only apply to the filesin the source list.The login name used on the destination host is the same as the local hostunless the destination name is of the format login@host..PPThe.B notifycommand is used to mail the list of files updated (and any errorsthat may have occurred) to the listed names.If no at sign (@) appears in the name, the destination host is appended to the name(for example, name1@host, name2@host, ...)..PPThe.B exceptcommand is used to update all of the files in the source list.B exceptfor the files listed in \fIname list\fP.This is usually used to copy everything in a directory except certain files..PPThe.B except_patcommand is like the.B exceptcommand except that \fIpattern list\fP is a list of regular expressions(see.MS ed 1for details).If one of the patterns matches some string within a file name, that file willbe ignored.Note that since \\e is a quote character, it must be doubled to becomepart of the regular expression.  Variables are expanded in \fIpattern list\fPbut not shell file pattern matching characters.  To include a dollar sign ($), itmust be escaped with \\e..PPThe.I specialcommand is used to specify.PN sh commands that are to be executed on theremote host after the file in \fIname list\fP is updated or installed.If the \fIname list\fP is omitted then the shell commands will be executedfor every file updated or installed.  The shell variable FILE is setto the current filename before executing the commands in.IR string ..I Stringstarts and ends with double quotes (") and can cross multiple lines in.I distfile.Multiple commands to the shell should be separated by semi-colons (;).Commands are executed in the user's home directory on the hostbeing updated.The.B specialcommand can be used to rebuild private databases, etc.after a program has been updated..PPThe following is a small example..nf.in +.5iHOSTS = ( matisse root@arpa)FILES = ( /bin /lib /usr/bin /usr/games	/usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}	/usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc	sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont )${FILES} -> ${HOSTS}	install \-R ;	except /usr/lib/${EXLIB} ;	except /usr/games/lib ;	special /usr/lib/sendmail "/usr/lib/sendmail \-bz" ;srcs:/usr/src/bin -> arpa	except_pat ( \e\e.o\e$ /SCCS\e$ ) ;IMAGEN = (ips dviimp catdvi)imagen:/usr/local/${IMAGEN} -> arpa	install /usr/local/lib ;	notify ralph ;${FILES} :: stamp.cory	notify root@cory ;.in.fi.SH RestrictionsSource files must reside on the local host where .PN rdist is executed..PPThere is no easy way to have a .B special command executed after all filesin a directory have been updated..PPVariable expansion only works for .I name lists; there should be a general macrofacility..PP.PN rdistaborts on files which have a negative mtime (before Jan 1, 1970)..SH DiagnosticsA complaint about mismatch of .PN rdist version numbers may really stemfrom some problem with starting your shell(that is, you are in too many groups)..SH Files.nf.ta \w'/tmp/rdist*    'udistfile	input command file/tmp/rdist*	temporary file for update lists.fi.SH See Alsosh(1), csh(1), stat(2)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?