DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Distributing files remotely over TCP/IP

Distributing software

You can use rdist to distribute source code, shell scripts, and so on. For example:

   FILES = (/usr/local/src/X11)
   

HOSTS = (yukon missouri yangtze)

${FILES} -> ${HOSTS} install -R; special /usr/local/src/X11/Makefile "echo date > time_updated"; special /usr/local/src/X11/Makefile "cd /usr/local/src/X11; make Makefiles;"

In this example, the install command is executed with the -R option. rdist will check the directory /usr/local/src/X11 on the remote machines and remove any files that do not exist in /usr/local/src/X11 on the local host. This is useful for maintaining consistent source code and removing old object files and executables.

This distfile shows examples of the special command. The first one executes the command:

echo date > time_updated

on each of the remote hosts if the file usr/local/src/X11/Makefile is updated. The file time_updated will be created in your home directory on the remote machine. This is the default unless you specify an absolute or relative pathname.

rdist uses the same userid for the remote and local hosts unless an alternate userid is specified:

   HOSTS = (yukon support@missouri yangtze)
On port, the update will be performed as user support, provided the appropriate permissions are in place for you to rcmd or rlogin from the local machine to the support account on port.

The second special in the example above shows how you can distribute files and then execute commands remotely. The format of the special command is

special [filename] ``command''

The filename argument is optional. If filename is specified, the command will only be executed on the remote host if that particular file is updated. If filename is not specified, the command will be executed for every file that is updated.

In the above example, rdist lets you create new makefiles from the newly distributed source if the file /usr/local/src/X11/Makefile is updated. Note the use of the semicolon (;) to separate the command lines. special also accepts the backslash (\) character as a line-continuation character.

The next example adds the packages feature to distribute multiple sets of software with one distfile:

   FILES_R4 = (/usr/local/src/X11_R4)
   FILES_R3 = (/usr/local/src/X11_R3)
   HOSTS = (yukon missouri yangtze)
   R4:
   ${FILES_R4} -> ${HOSTS}
   	install -R;
   R3:
   ${FILES_R3} -> ${HOSTS}
   	install -R;
You can distribute the appropriate package by issuing one of the following commands:

rdist R3
updates FILES_R3

rdist R4
updates FILES_R4

rdist
updates all packages

Next topic: Notifying users of updates
Previous topic: Using rdist

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003