Installing and Administering Internet Services

328 Chapter 10
Using rdist
Creating the Distfile
If there is no install command in a distfile or if the destpath option is
not used with the install command, the name of the file on the master
host is given to the remote host’s file. Parent directories in a file’s path
are created on a remote host if they do not exist. rdist does not replace
non-empty directories on a remote host. However, if the -R option is
specified with the install command, a non-empty directory is removed
on the remote host if the corresponding directory does not exist on the
master host.
For a detailed description of commands and their options, type
man 1 rdist at the HP-UX prompt.
The following two examples of file distribution commands use the
variable definitions that were shown previously:
${FILES} -> ${HOSTS}
install -R ;
except /usr/lib/${EXLIB} ;
except /usr/games/lib ;
srcs:
/usr/src/bin -> arpa
except_pat ( \\.o$ /SCCS\$ ) ;
The first example distributes the source files defined in the variable
FILES to the destination hosts defined in the variable HOSTS. rdist
copies the files to each remote host, removing files in the remote host’s
directory that do not exist on the master directory. rdist does not
update files in /usr/lib/${EXLIB} or in /usr/games/lib.
except file_list Updates all files in the source list except for the file(s)
specified in file_list.
except_pat pattern Updates all files in the source list except for those files
whose names contain the pattern pattern. The
characters “\” and “$” must be escaped with a backslash
(\).
special [file] ”command Specifies command(s) that are to be executed on the
remote host after each specified file is updated or
installed. Used to rebuild databases and configuration
files after a program has been updated. If file is not
specified, command is performed for every updated file.
command can contain multiple commands, each
separated by semicolons. The user’s home directory on
the remote host is the default working directory for each
command.