This document describes the old AIX® rdist command located in the /usr/bin/rdist file as well as the new /usr/sbin/rdist command which is used with the new rdistd daemon.
Remote file distribution client program.
To Use a Distribution File
rdist [ -n ] [ -q ] [ -b ] [ -D ] [ -R ] [ -h ] [ -i ] [ -v ] [ -w ] [ -y ] [ -f FileName ] [ -d Argument=Value ] [ -m Host ] ... [ Name ] ...
To Interpret Arguments as a Small Distribution File
rdist [ -n ] [ -q ] [ -b ] [ -D ] [ -R ] [ -h ] [ -i ] [ -v ] [ -w ] [ -y ] -c Name ... [ Login@ ] Host [ :Destination ]
The rdist command maintains identical copies of files on multiple hosts. The rdist command preserves the owner, group, mode, and modified time of files, if possible, and can update programs that are running. The rdist command can receive direction from the following sources:
If you do not use the -f flag, the rdist command looks for the distfile file in your $HOME directory. If it doesn't find a distfile file, it looks for Distfile file.
The value specified by the Name parameter is read as the name of a file to be updated or a subcommand to execute. If you do not specify a value for the Name parameter on the command line, the rdist command updates all the files and directories listed in the distribution file. If you specify - (minus sign) for the Name parameter, the rdist command uses standard input. If the name of a file specified by the Name parameter is the same as the name of a subcommand, the rdist command interprets the Name parameter as a subcommand.
The rdist command requires that a .rhosts file be configured on each host. See File Format for TCP/IP in AIX Version 7.1 Files Reference for details.
Item | Description |
---|---|
-b | Performs a binary comparison and updates files if they differ. |
-c | Directs the rdist command to interpret the remaining
arguments as a small distribution file. Available arguments are:
Note: Do not use the -c flag with the -f, -d,
or -m flag.
|
-d Argument=Value | Defines the Argument variable as having the value specified by the Value variable. The -d flag defines or overrides variable definitions in the distfile file. The Value variable can be specified as an empty string, one name, or a list of names surrounded by parentheses and separated by tabs or spaces. |
-D | Turns on the debugging output. |
-f FileName | Specifies the name of the distribution file. If you do not use the -f flag, the default value is the distfile or Distfile file in your $HOME directory. |
-h | Copies the file that the link points to rather than the link itself. |
-i | Ignores unresolved links. The rdist command maintains the link structure of files being transferred and warns users if it cannot find all the links. |
-m Host | Limits which machines are to be updated. You can use the -m Host option multiple times to limit updates to a subset of the hosts listed in the distfile file. |
-n | Prints the subcommands without executing them. Use the -n flag to debug the distfile file. |
-q | Operates in quiet mode. The -q option suppresses printing of modified files on standard output. |
-R | Removes extraneous files. If a directory is being updated, any files that exist on the remote host but not in the master directory are removed. Use the -R flag to maintain identical copies of directories. |
-v | Verifies that the files are up-to-date on all hosts; files that are out-of-date are then displayed. However, the rdist -v command neither changes files nor sends mail. This flag overrides the -b flag when they are used together. |
-y | Prevents recent copies of files from being replaced by files that are not as recent. Files are normally updated when their time stamp and size differ. The -y flag prevents the rdist command from updating files more recent than the master file. |
-w | Appends the entire path name of the file to the destination directory name. Normally, the rdist command uses only the last component of a name for renaming files, preserving the directory structure of the copied files. When the -w flag is used with a file name that begins with a ~ (tilde), everything except the home directory is appended to the destination name. File names that do not begin with a / (slash) or a ~ (tilde) use the destination user's home directory as the root directory for the rest of the file name. |
The distribution file specifies the files to copy, destination hosts for distribution, and operations to perform when updating files to be distributed with the rdist command. Normally, the rdist command uses the distfile file in your $HOME directory. You can specify a different file If you use the -f flag.
Entry Formats
Each entry in the distribution file has one of the following formats:
Item | Description |
---|---|
VariableName = NameList | Defines variables used in other entries of the distribution file (SourceList, DestinationList, or SubcommandList). |
[Label:] SourceList -> DestinationList SubcommandList | Directs the rdist command to distribute files named in the SourceList variable to hosts named in the DestinationList variable. Distribution file commands perform additional functions. |
[Label:] SourceList :: TimeStampFile SubcommandList | Directs the rdist command to update files that have changed since a given date. Distribution file subcommands perform additional functions. Each file specified with the SourceList variable is updated if the file is newer than the time-stamp file. This format is useful for restoring files. |
Labels are optional and used to identify a subcommand for partial updates.
Entries
Item | Description |
---|---|
VariableName | Identifies the variable used in the distribution file. |
NameList | Specifies a list of files and directories, hosts, or subcommands. |
SourceList | Specifies files and directories on the local host for the rdist command to use as the master copy for distribution. |
DestinationList | Indicates hosts to receive copies of the files. |
SubcommandList | Lists distribution file subcommands to be executed. |
The rdist command treats new-line characters, tabs, and blanks as separators. Distribution file variables for expansion begin with a $ (dollar sign) followed by a single character or a name enclosed in {} (braces). Comments begin with a # (pound sign) and end with a new-line character.
Source and Destination List Format
The distribution file source and destination lists comprise zero or more names separated by blanks, as shown in the following format:
[Name1] [Name2] [Name3] ...
The rdist command recognizes and expands the following shell metacharacters on the local host in the same way as for the csh command.
To prevent these characters from being expanded, precede them with a \ (backslash). The rdist command also expands the ~ (tilde) in the same way as for the csh command, but does so separately on the local and destination hosts.
Distribution File Subcommands
Multiple commands to the shell must be separated by a ; (semicolon). Commands are executed in the user's home directory on the host being updated. The special subcommand can be used to rebuild private databases after a program has been updated.
The distribution file subcommand list may contain zero or more of the following subcommands:
Item | Description |
---|---|
install Options [OptionalDestName]; | Copies out-of-date files and directories. The rdist command
copies each source file or directory to each host in the destination
list. The available options as specified by the Options variable
are the rdist command flags -b, -h, -i, -R, -v, -w,
and -y. These options only apply to the files specified by
the SourceList variable. When you use the -R flag, nonempty
directories are removed if the corresponding file name is absent on
the master host. The OptionalDestName parameter renames files.
If no install subcommand appears in the subcommand list or the destination name is not specified, the source file name is used. Directories in the path name are created if they do not exist on the remote host. The login name used on the destination host is the same as the local host unless the destination name is of the format login@host. |
notify NameList; | Mails the list of updated files and any errors that may have occurred to the listed names (the NameList parameter). If no @ (at sign) appears in the name, the destination host is appended to the name (name@host). |
except NameList; | Causes the rdist command to update all the files specified by the SourceList entry except for those files specified by the NameList variable. |
except_pat NameList; | Prevents the rdist command from updating any files that contain a string that matches a member of the list specified by the NameList variable. |
special NameList "String"; | Specifies shell commands (the "String" variable) to be executed on the remote host after the file specified by the NameList variable is updated or installed. If the NameList variable is omitted, the shell commands are executed for every file updated or installed. The shell variable FILE is set to the current file name before the rdist command executes the "String" variable. The "String" value must be enclosed in " " (double quotation marks) and can cross multiple lines in the distribution file. |
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | Specifies that an error occurred. |
Examples of the Format: VariableName = NameList
HOSTS =( matisse root@arpa )
where
the HOSTS variable is defined to be matisse and root@arpa.
The rdist command updates files on the hosts matisse and root@arpa.
You could use this variable as a destination list.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 )
where
the FILES value is defined to be the files to be used for
the SourceList entry. EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc
sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont)
where
the EXLIB value is defined as a list of files to exclude
from the updating process./usr/src/bin ->arpa
except_pat(\e\e.o\e ${<namelist> /SCCS\e ${<namelist>}
or
/usr/src/bin ->arpa
except_pat(\\.o\e ${<namelist> /SCCS\e ${<namelist>}
/usr/src/bin ->arpa
except_pat(\\.o\$ /SCCS\$
Examples of the Format: [label:] SourceList - DestinationList SubcommandList
${FILES} ->${HOSTS}
install -R
except /usr/lib/${EXLIB} ;
except /usr/games/lib ;
special /usr/sbin/sendmail "/usr/sbin/sendmail.bz" ;
The
[Label:] entry of the line is optional and not shown
here. The $ (dollar sign) and the {} (braces) cause the file names FILES, HOSTS,
and EXLIB to be expanded into the lists designated for them
in the previous examples. The rest of the example comprises the subcommand
list.srcsL:
/usr/src/bin -> arpa
except_pat (\e\e.o\e$ /SCCS\e$ ) ;
The label is srcsL: and can be used to identify this entry for updating. The /usr/src/bin file is the source to be copied and host arpa is the destination of the copy. The third line contains a subcommand from the subcommand list.
${FILES} :: stamp.cory
notify root@cory
The $ (dollar sign) and {} (braces)
cause the name specified by FILES to be expanded into the
list designated for it. The time-stamp file is stamp.cory.
The last line is a subcommand from the subcommand list.Item | Description |
---|---|
/usr/bin/rdist | Contains the rdist command. |
$HOME/distfile | Contains a list of subcommands to be read by the rdist command. |
/tmp/rdist | Contains an update list. This is a temporary file. |
This document describes the old AIX rdist command located in the /usr/bin/rdist file as well as the new /usr/sbin/rdist command which is used with the new rdistd daemon.
Client program for distributing files remotely.
To Use a Distribution File
/usr/sbin/rdist [ -F n ] [ -A num ] [ -a num ] [ -d var=value] [ -l < local logopts> ] [ -L <remote logopts> ] [ -f distfile] [ -M maxproc -m host ] [ -o distops ] [ -t timeout ] [ -p <rdist-path> ] [ -P <transport-path> ] [ name ... ]
To Interpret Arguments as a Small Distribution File
/usr/sbin/rdist -Fn -c name ... [ login@ ] host [ :dest ]
To Invoke the Old rdist as a Server
/usr/sbin/rdist -Server
For Version Information
/usr/sbin/rdist -V
( filename ... ) -> [user@]host
install [dest name] ;
If no name arguments are specified, rdist will update all of the files and directories listed in distfile. Otherwise, the argument is taken to be the name of a file to be updated or the label of a command to execute. If the label and file names conflict, it is assumed to be a label. These may be used together to update specific files using specific commands.
The -Server option provides backward compatibility for older versions of rdist which used this option to put rdist into server mode. If rdist is started with the -Server command line option, it will attempt to run the old version of rdist. This option will only work if the old rdist is located at /usr/bin/rdist.
/bin/sh -c rdistd -S
rsh host -l remuser rdistd -S
In the example above, the host parameter is the name of the target host, remuser is the name of the user to make the connection as and, rdistd is the rdist server command on the target host.
The transport program must be compatible with the above syntax for rsh. If not, the transport program should be wrapped in a shell script which understands this command line syntax.
On each target host rdist will run the following command:
rdistd -S
or
<rdistd path> -S
In the example above, the -p flag was specified. If -p flag is not included, or the <rdistd path> is a simple filename, rdistd or <rdistd path> must be somewhere in the PATH of the user running rdist on the remote (target) host.
Item | Description |
---|---|
TMPDIR | Name of temporary directory to use. Default is /tmp. |
Item | Description |
---|---|
-A num | Update or install files only if a minimum number of free files (inodes) exists on a filesystem. |
-a num | Update or install files only if a minimum amount of free space exists on a filesystem. |
-d var = value | Assign value to variable var. This option is used to define or override variable definitions in the distfile. Value can be the empty string, one name, or a list of names surrounded by parentheses and separated by tabs and/or spaces. |
-F | Update all clients sequentially without forking child processes. |
-f distfile | Use distfile as the distribution file. If distfile is specified as -, read from standard input. |
-l logopts | Sets local logging options. See the Message Logging section for more information on the syntax for logopts. |
-L logopts | Sets remote logging options. logopts is the same as for local logging except the values are passed to the remote server (rdistd ). See the Message Logging section for more information on the syntax of logopts. |
-M num | Limit the maximum number of simultaneously running child rdist processes to num. The default is 4. |
-m machine | Limits the updating of files to the given machine. Multiple -m arguments can be given to limit updates to a subset of the hosts listed in the distfile. |
-n | Display but do not execute commands. Use the -n flag to debug distfile. |
-o distopts | Specifies the dist options to enable. distopts is a
comma separated list of options listed below. The valid values for distopts are:
|
-o distopts | (dist options, continued):
|
-p <rdist-path> | Search for the rdistd server in the given path on the target host. |
-P <rdist-path> | Use the transport program as given in transport-path. The transport-path may be a colon seperated list of possible pathnames. In this case, the first component of the path to exist is used. |
-t timeout | Sets the timeout period (in seconds) for waiting for responses from the remote rdist server. The default is 900 seconds. |
-V | Prints the version information and exits. |
The rdist command provides a set of message facilities, each of which contains a list of message types specifying which types of messages to send to that facility. The local client (rdist) and the remote server (rdistd) each maintain separate copies of what types of messages to log to what facilities.
The -l logopts flag specifies what logging options to use locally on the client. The -L logopts flag specifies what logging options to pass to the remote rdistd server.
facility=types:facility= types...
The distribution file specifies the files to copy, destination hosts for distribution, and operations to perform when updating files to be distributed with the rdist command.
Entry Formats
Labels are optional. They are used to identify a command for partial updates.
Entries
Item | Description |
---|---|
VariableName | Identifies the variable used in the distribution file. |
NameList | Specifies a list of files and directories, hosts, or subcommands. |
SourceList | Specifies files and directories on the local host for the rdist command to use as the master copy for distribution. |
DestinationList | Indicates hosts to receive copies of the files. |
SubcommandList | Lists distribution file subcommands to be executed. |
The rdist command treats newline characters, tabs, and blanks as separators. Distribution file variables for expansion begin with a dollar sign followed by a single character or a name enclosed in braces.
Comments begin with a pound sign and end with a newline character.
Source and Destination List Format
[Name1] [Name2] [Name3] ...
To prevent these characters from being expanded, precede them with a backslash. The rdist command also expands the tilde in the same way as for the csh command, but does so separately on the local and destination hosts. When the -o whole option is used with a file name that begins with a tilde, everything except the home directory is appended to the destination name. File names which do not begin with a forward slash or a tilde use the destination user's home directory as the root directory for the rest of the file name.
Distribution File Subcommands
Multiple commands to the shell must be separated by a semicolon. Commands are executed in the user's home directory on the host being updated. The special subcommand can be used to rebuild private databases after a program has been updated.
When you use the -R flag, nonempty directories are removed if the corresponding file name is absent on the master host. The OptionalDestName parameter renames files.
If no install subcommand appears in the subcommand list or the destination name is not specified, the source file name is used. Directories in the path name are created if they do not exist on the remote host.
The login name used on the destination host is the same as the local host unless the destination name is of the format login@host.
NFS checks are disabled if a hostname ends in a plus sign. This is equivalent to disabling the -o chknfs option just for this one host.
This command returns the following exit values:
Item | Description |
---|---|
0 | Successful completion. |
>0 | An error occurred. |
HOSTS =( matisse root@arpa )
In the above example, the HOSTS variable is defined to be matisse and root@arpa. The rdist command updates files on the hosts matisse and root@arpa.
You could use this variable as a destination list.
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 )
In the above example, the FILES value is defined to be the files to be used for the SourceList entry.
EXLIB = ( Mail.rc aliases aliases.dir aliases.pag crontab dshrc
sendmail.cf sendmail.fc sendmail.hf sendmail.st uucp vfont)
In the above example, the EXLIB value is defined as a list of files to exclude from the updating process.
/usr/src/bin ->arpa
except_pat(\e\e.o\e ${<namelist> /SCCS\e ${<namelist>}
or
/usr/src/bin ->arpa
except_pat(\\.o\e ${<namelist> /SCCS\e ${<namelist>}
/usr/src/bin ->arpa
except_pat(\\.o\$ /SCCS\$
${FILES} ->${HOSTS}
install -R
except /usr/lib/${EXLIB} ;
except /usr/games/lib ;
special /usr/sbin/sendmail "/usr/sbin/sendmail.bz" ;
The [Label:] entry of the line is optional and not shown here. Thedollar sign and the braces cause the file names FILES, HOSTS, and EXLIB to be expanded into the lists designated for them in the previous examples.
The rest of the example comprises the subcommand list.
srcsL:
/usr/src/bin -> arpa
except_pat (\e\e.o\e$ /SCCS\e$ ) ;
The label is srcsL: and can be used to identify this entry for updating. The /usr/src/bin file is the source to be copied and host arpa is the destination of the copy.
The third line contains a subcommand from the subcommand list.
${FILES} :: stamp.cory
notify root@cory
The dollar sign and braces cause the name specified by FILES to be expanded into the list designated for it. The time-stamp file is stamp.cory.
The last line is a subcommand from the subcommand list.
Item | Description |
---|---|
/usr/sbin/rdist | Contains the rdist command at version 6.1.5. |
distfile | Contains the input commands. |
$ TMPDIR/rdist* | The temporary file for update lists. |