Distributing Software Modules Using rsync
Ed Schaefer and John Spurgeon
Distributing software packages to all of our servers is a
tedious task. Currently, a release manager makes a connection to each server
and transfers files using ftp. This involves entering passwords multiple times,
waiting for transfers to complete, changing directories, and keeping files
organized. We developed a shell script, distribute_release (
Listing 1
), that
makes the job easier.
Our script has some advantages over the ftp process:
- Directory trees can be used to organize release modules.
- A distribution network defines how files are
transferred from server to server.
- When a release module is ready to be
distributed, it is replicated to all of the servers in the network using rsync,
which helps minimize network traffic.
- Various authentication methods can be used to
avoid entering passwords for each server.
We’ll describe the directory structures including
creating the distribution network. Then we’ll talk about the scripts. Finally,
we’ll discuss an example.
Directory Structures
Each release module is stored in the directory
/var/spool/pkg/release/[module]/. A module directory can be flat, or it can
contain subdirectories. Hidden directory trees under the ./release/ directory
define the distribution network. Therefore, the names of these directories
cannot be used as module names.
Transport protocols supported by distribute_release
include nfs, rsh, and ssh. If a release module is distributed using nfs, then
the directory /var/spool/pkg/release/.nfs/[module]/ contains symbolic links
corresponding to the hosts in the server’s distribution network:
/var/spool/pkg/release/.n
|