PCP(1)

NAME
pcp - copy a file to a cluster of machines

SYNOPSIS
pcp [-ceprv] [-f fanout] [-g rungroup1,...,rungroupN] [-w node1,...,nodeN] [-x node1,...,nodeN] source_file1 [source_file2 ... source_fileN] [destination file]

DESCRIPTION
The pcp utility can be used to copy a file, or directory to a group of machines. The group of machines can be listed on the command line, or default to the environment setting CLUSTER The following options are available:

-c  Normally pcp copies files serially, to all the nodes specified. When the -c option is used, pcp will copy the files in parallel to the nodes, subject to the FANOUT environment setting and -f option. Smaller files will benefit greatly from parallel copies, due to reduced latency in the initial authentication, and connection. However, large files, especially on a shared ethernet, will suffer tremendous speed degredation, because of the collisions the transfers will create. This effect can be reduced, by lowering the fanout size of the cluster.

-e  Unless the -e option is specified, output from remote commands will not be reported to the user.

-p  The -p option causes pcp to attempt to preserve (duplicate) in its copies the modification times and modes of the source files, ignoring the umask. By default, the mode and owner of file2 are preserved if it already existed; otherwise the mode of the source file modified by the umask(2) on the destination host is used.

-r  If any of the source files are directories, pcp copies each subtree rooted at that name; in this case the destination must be a directory.

-v  Prints the version of ClusterIt to the stdout, and exits.

-f  If the -f option is specified, followed by a number, it sets the fanout size of the cluster. The fanout size is the number of nodes a command will run on in parallel at one time. Thus a 80 node cluster, with a fanout size of 64, would run 64 nodes in parallel, then, when all have finished, it would execute the command on the last 16 nodes. The fanout size defaults to 64. This option overrides the FANOUT environment variable.

-g  If the -g option is specified, followed by a comma separated list of group names, the command will only be run on that group of nodes. A node may be a part of more than one group if desired, however running without the -g option will run the command on the same node as many times as it appears in the file specified by the CLUSTER environment variable. This option is silently ignored if used with the -w option.

-w  If the -w option is specified, followed by a comma delimited list of machine names, the command will be run on each node in the list. Without this flag, pcp runs on the nodes listed in the file pointed to by the CLUSTER environment variable.

-x  The -x option can be used to exclude specific nodes from the cluster. The format is the same as the -w option, a comma delimited list of machine names. This option is silently ignored if used with the -w option.

ENVIRONMENT
pcp utilizes the following environment variables:

CLUSTER
    Contains a filename, which is a newline separated list of nodes in the cluster.

RCP_CMD
    Command to use to copy files to remote machines. The command chosen must be able to connect with no password to the remote host. Defaults to scp

RCP_USER
    The username to connect to remote machines as by default.

FANOUT
    When set, limits the maximum number of concurrent commands sent at once. This can be used to keep from overloading a small host when sending out commands in parallel. Defaults to 64. This environment setting can be overridden by the -f option.

EXAMPLES
The command:

pcp file

will copy the file ‘file’ to the home directory of the current user on all machines listed in the file pointed to by the CLUSTER environment setting.

The command:

pcp -w hadar,rigel file

will copy the file ‘file’ to the home directory of the current user on the machines ‘hadar’ and ‘rigel’.

The command:

pcp -w hadar,rigel /usr/bin/foo /usr/local/bin/foo

will copy the file ‘/usr/bin/foo’ to ‘/usr/local/bin/foo’ on the machines ‘hadar’ and ‘rigel’.

DIAGNOSTICS
Exit status is 0 on success, 1 if an error occurs.

SEE ALSO
cp(1), dsh(1), rcp(1), kerberos(3), hosts.equiv(5), rhosts(5)

HISTORY
The pcp command appeared in clusterit 1.0. It is based on the pcp command in IBM PSSP.

AUTHOR
Pcp was written by Tim Rightnour.