rcmd
Package: WA2L/edrc 1.5.57
Section: General Commands (1)
Updated: 03 April 2013
Index
Return to Main Contents
 
NAME
rcmd - run command(s) on host(s)
 
SYNOPSIS
edrc/bin/rcmd
[
-h
]
rcmd
[
-n
][
-q
][
-r
[
num
]][
-t host_1,host_2,host_n
][
-c command
]
 
AVAILABILITY
WA2L/edrc
 
DESCRIPTION
The
rcmd
command is used to run a command or a set of commands on a set of hosts.
You can specify the command(s) on the command line, if you don't you are
prompted for it.
The interactive query of hosts suggests as default the hosts as defined
in the
EXEC_HOSTLIST
setting in the
rcmd.cfg
file.
Furthermore it is possible to  enter hostgroups ( 
@HOSTGROUP
), as known from the 
hostlist
command. It is possible to specify multiple hostgroups or to mix 
hostgroups with hostnames. When using hostgroups the input default is
expanded and the target prompt is repeated to give the user the 
opportunity to verify the target list and to correct it if needed. 
All output as received from the commands started on the target
hosts is printed to 
stdout,
all
rcmd 
state output and dialog is printed to
stderr
to enable the user to do further output processing of the received
data, see also
-n
and
-q
options.
 
OPTIONS
- -h
 - 
usage message.
 - -n
 - 
Do not indent the command output as received from the target host.
This is useful if it is needed to do further output processing.
 - -q
 - 
Quiet run, no state information is printed to 
stderr.
To process the received output it is not imperative to use the
-q
option.
 - -r [ retries ]
 - 
number of retries to connect to the target host, if it was not
possible to connect at the first try. This option can be used
when using
rcmd
in unattended script runs. If
retries
is not set, the default as set in
CONNECTION_RETRIES
in the
rcmd.cfg
config file applies.
If
-r
is not used in non-interactive script runs, this default applies, too.
The interval of retries is eight seconds, if not specified differently in
RETRY_INTERVAL
in the
etc/rcmd.cfg
configuration file.
 - -t hostlist
 - 
A comma separated list of target hosts. If the hostlist is not specified, 
an interactive query asks for it. The default hostlist for the interactive
query is as defined in the
EXEC_HOSTLIST
setting in the
rcmd.cfg 
config file.
See also 
resolve_targetlist(3)
to see how to efficiently create a hostlist in scripts.
 - -c command
 - 
commands to be executed on the target nodes. If the commands are
not specified on the command line a convenient interactive query allows
to input the commands, even easy input editing is provided.
 
 
ENVIRONMENT
-
 
EXIT STATUS
- 0
 - 
no error.
 - 2
 - 
operating system is not supported, yet. See
osid(3)
if you get this error.
 - 4
 - 
usage printed.
 - 5
 - 
the execution has been aborted using
Ctrl+C.
 - 6
 - 
the configuration file
rcmd.cfg
does not exist.
 - 11 
 - 
temporary directory could not be claimed or created in
/tmp.
Check the system temporary directory
/tmp
if you get this error, it is an indicator of system intrusion.
 
 
FILES
- etc/rcmd.cfg
 - 
configuration file of 
rcmd,
see  
rcmd.cfg(4)
for more information.
 - var/log/rcmd.log
 - 
default logfile of
rcmd.
 - etc/exrc
 - 
settings for the
vi
/
vim
editor.
 
 
EXAMPLES
-
 
SEE ALSO
edrcintro(1),
edrcsetup(1m),
hostaliases(3),
hostlist(3),
remote_shell(3),
remote_copy(3),
rcmd.cfg(4),
resolve_targetlist(3),
ssh-exec(1),
syspoll(1)
 
NOTES
-
 
BUGS
-
 
AUTHOR
rcmd was developed by Christian Walther. Send suggestions
and bug reports to wa2l@users.sourceforge.net .
 
COPYRIGHT
Copyright © 2013
by Christian Walther
This is free software; see
edrc/doc/COPYING
for copying conditions. There is ABSOLUTELY NO WARRANTY; not
even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
This document was created by man2html
using the manual pages.
Time: 00:14:20 GMT, March 08, 2025