📄 rdist.1
字号:
.\" Copyright (c) 1985, 1990, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)rdist.1 8.3 (Berkeley) 3/17/94.\".Dd March 17, 1994.Dt RDIST 1.Os BSD 4.3.Sh NAME.Nm rdist.Nd remote file distribution program.Sh SYNOPSIS.Nm rdist.Op Fl nqbRhivwy.Op Fl f Ar distfile.Op Fl d Ar var=value.Op Fl m Ar host.Op Ar name ....Nm rdist.Op Fl nqbRhivwy.Fl c.Ar name ....Oo login@ Oc Ns Ar host Ns Op :dest.Sh DESCRIPTION.Nm Rdistis a program to maintain 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..Nm Rdistreads commands from.Ar distfileto direct the updating of files and/or directories..PpOptions specific to the first SYNOPSIS form:.Pp.Bl -tag -width indent.It FlIf.Ar distfileis.Sq Fl ,the standard input is used..It Fl f Ar distfileUse the specified.Ar distfile..El.PpIf either the.Fl for.Sq Floption is not specified, the program looks first for.Dq Pa distfile ,then.Dq Pa Distfileto use as the input.If no names are specified on the command line,.Nm rdistwill update all of the files and directories listed in.Ar 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..PpOptions specific to the second SYNOPSIS form:.Pp.Bl -tag -width Fl c.It Fl cForces.Nm rdistto interpret the remaining arguments as a small.Ar distfile ..PpThe equivalent distfile is as follows..Pp.Bd -filled -offset indent -compact.Pq Ar name ....Li ->.Op Ar login@.Ar host.Bd -filled -offset indent -compact.Li install.Op Ar dest ;.Ed.Ed.El.PpOptions common to both forms:.Pp.Bl -tag -width Ic.It Fl bBinary comparison. Perform a binary comparison and update files if they differrather than comparing dates and sizes..It Fl d Ar var=valueDefine.Ar varto have.Ar value .The.Fl doption is used to define or override variable definitions in the.Ar distfile ..Ar Valuecan be the empty string, one name, or a list of names surrounded byparentheses and separated by tabs and/or spaces..It Fl hFollow symbolic links. Copy the file that the link points to rather than thelink itself..It Fl iIgnore unresolved links..Nm Rdistwill normally try to maintain the link structure of files being transferredand warn the user if all the links cannot be found..It Fl m Ar hostLimit which machines are to be updated. Multiple.Fl marguments can be given to limit updates to a subset of the hosts listed in the.Ar distfile ..It Fl nPrint the commands without executing them. This option isuseful for debugging.Ar distfile ..It Fl qQuiet mode. Files that are being modified are normallyprinted on standard output. The.Fl qoption suppresses this..It Fl 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..It Fl 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..It Fl 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..It Fl yYounger mode. Files are normally updated if their.Ar mtimeand.Ar size(see.Xr stat 2 )disagree. The.Fl yoption causes.Nm 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..El.Pp.Ar 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..Pp.Bd -literal -offset indent -compact<variable name> `=' <name list>[label:]<source list> `\->' <destination list> <command list>[label:]<source list> `::' <time_stamp file> <command list>.Ed.PpThe 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.Ar source listspecifies alist of files and/or directories on the local host which are to be usedas the master copy for distribution.The.Ar destination listis the list of hosts to which these files are to becopied. Each file in the 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)..PpLabels 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 `#' and end with a newline..PpVariables to be expanded begin with `$' followed by one character ora name enclosed in curly braces (see the examples at the end)..PpThe source and destination lists have the following format:.Bd -literal -offset indent<name>.Edor.Bd -literal -offset indent -compact`(' <zero or more names separated by white-space> `)'.Ed.PpThe shell meta-characters `[', `]', `{', `}', `*', and `?'are recognized and expanded (on the local host only) in the same way as.Xr csh 1 .They can be escaped with a backslash.The `~' character is also expanded in the same way as.Xr csh 1but is expanded separately on the local and destination hosts.When the.Fl woption is used with a file name that begins with `~', 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..Bd -ragged -offset indent -compact.Bl -column except_patx pattern\ listx.It `install' <options> opt_dest_name `;'.It `notify' <name list> `;'.It `except' <name list> `;'.It `except_pat' <pattern list> `;'.It `special' <name list> string `;'.El.Ed.PpThe.Ic 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..Ar Opt_dest_nameis an optional parameter to rename files.If no.Ic 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 `\-R' option a non-empty directory will be removedif the corresponding filename is completely absent on the master host.The.Ar optionsare `\-R', `\-h', `\-i', `\-v', `\-w', `\-y', and `\-b'and 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.Ic notifycommand is used to mail the list of files updated (and any errorsthat may have occurred) to the listed names.If no `@' appears in the name, the destination host is appended tothe name(e.g., name1@host, name2@host, ...)..PpThe.Ic exceptcommand is used to update all of the files in the source list.Ic exceptfor the files listed in.Ar name list .This is usually used to copy everything in a directory except certain files..PpThe.Ic except_patcommand is like the.Ic exceptcommand except that.Ar pattern listis a list of regular expressions(see.Xr 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.Ar pattern listbut not shell file pattern matching characters. To include a `$', itmust be escaped with `\e'..PpThe.Ic specialcommand is used to specify.Xr sh 1commands that are to be executed on theremote host after the file in.Ar name listis updated or installed.If the.Ar name listis 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.Ar string ..Ar Stringstarts and ends with `"' and can cross multiple lines in.Ar distfile .Multiple commands to the shell should be separated by `;'.Commands are executed in the user's home directory on the hostbeing updated.The.Ar specialcommand can be used to rebuild private databases, etc.after a program has been updated..PpThe following is a small example:.Bd -literal -offset indentHOSTS = ( matisse root@arpa )FILES = ( /bin /lib /usr/bin /usr/games\t/usr/include/{*.h,{stand,sys,vax*,pascal,machine}/*.h}\t/usr/lib /usr/man/man? /usr/ucb /usr/local/rdist )EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc\tsendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont )${FILES} -> ${HOSTS}\tinstall -R ;\texcept /usr/lib/${EXLIB} ;\texcept /usr/games/lib ;\tspecial /usr/lib/sendmail "/usr/lib/sendmail -bz" ;srcs:/usr/src/bin -> arpa\texcept_pat ( \e\e.o\e$ /SCCS\e$ ) ;IMAGEN = (ips dviimp catdvi)imagen:/usr/local/${IMAGEN} -> arpa\tinstall /usr/local/lib ;\tnotify ralph ;${FILES} :: stamp.cory\tnotify root@cory ;.Ed.Sh FILES.Bl -tag -width /tmp/rdist* -compact.It Pa distfileinput command file.It Pa /tmp/rdist*temporary file for update lists.El.Sh SEE ALSO.Xr sh 1 ,.Xr csh 1 ,.Xr stat 2.Sh HISTORYThe.Nm rdistcommand appeared in.Bx 4.3 ..Sh DIAGNOSTICSA complaint about mismatch of rdist version numbers may really stemfrom some problem with starting your shell, e.g., you are in too many groups..Sh BUGSSource files must reside on the local host where.Nm rdistis executed..PpThere is no easy way to have a special command executed after all filesin a directory have been updated..PpVariable expansion only works for name lists; there should be a general macrofacility..Pp.Nm Rdistaborts on files which have a negative mtime (before Jan 1, 1970)..PpThere should be a `force' option to allow replacement of non-empty directoriesby regular files or symlinks. A means of updating file modes and ownersof otherwise identical files is also needed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -