lsgrun - execute a task on a set of hosts
lsgrun [ -h ] [ -V ] [ -i ] [ -P ] [ -p ] [ -v ] -f host_file | -m host_name ...| -n needed -R [res_req] [ task [argument ... ]]
Execute a task on the specified list of hosts. This is useful for fast global operations such as starting daemons, replicating files to or from local disks, looking for processes running on all hosts, checking who is logged in on each host, and so on. The hosts can be specified using a host file, a list of host names or by letting the system select the hosts.
-h Print command usage to stderr and exit.
-V Print LSF release version to stderr and exit.
-f host_file
Specify a file that contains a list of host names. The host names are
separated by white space characters (for example, SPACE, TAB, and NEWLINE).
When this option is specified, task will be executed on all
hosts listed in host_file. This option is exclusive of options -n, R,
and -m.
-i Interactive operation mode. If specified, you are asked if task will be executed on all hosts. If you answer `y', then the task is started on all hosts specified in the list; otherwise, you are asked interactively to specify each host in the list. If this option is not specified, no interactive questions will be asked.
-m host_name ...
Specify a list of host names to execute task. This is an alternative
to the -f option. This option is exclusive of options -n, -R, and -m.
If multiple host names are specified, the host names must be enclosed
by «» or `'.
-n needed
Specify the number of processors to run task. Each processor is used
to execute task. One host may be used to start several tasks if the
host is a multiprocessor. This option can be used together with option
-R to select desired hosts. This option is exclusive of options -m,
and -f. If this option is not given, the default is to use as many
processors as available to run task..
-R res_req
Specify the resource requirement expression for host selection. The
resource requirement will be used to choose from all hosts with the
same host type as the local host, unless a «type == value» exists in
res_req to specify otherwise. This option can be used together with
option -n to choose a specified number of processors to run task. If
this option is not given, the default resource requirement is r15s:pg.
-P Specify that a pseudo-terminal is to be created. This is necessary to run programs requiring a pseudo-terminal (for example, vi). By default, lsgrun does not create a pseudo-terminal. This option is ignored if -p is given.
-p Parallel run mode. If specified, the task is executed on all hosts simultaneously and without pseudo tty support. The -P option is ignored even if it is specified. This is useful for fast start up of tasks. However, any output of the remote tasks will arrive at the terminal in an arbitrary order, depending on the task execution speeds on individual hosts. If this option is not specified, then the task will be executed on the hosts sequentially with full pseudo tty support.
-v Verbose mode. Display the name of the execution host or hosts.
task [ arg ...]
The name of the task. If specified, then the command `task [ arg ...]'
is executed on the listed hosts. If this option is not specified, then
a prompt `Command>' is displayed to allow users to type in a command
terminated by a CTRL-D or EOF. The command is then executed on the
list of hosts. This must be the last argument on the command line.
Exit status is 0 if all commands executed correctly; otherwise, the exit status is the first non-zero status returned by a remotely executed task. lsgrun will execute the task on all hosts even if some have non-zero exit status. Exit status is -10 if a problem is detected in LSF.
lsfintro(1) , lsrun(1) , lsplace(1)