gsh - Global Shell run commands in parallel to multiple machines
gsh [OPTIONS] SYSTEMS CMD...
SYSTEMS is a combination of ghost macros. See ghosts(1). CMD is the command to run
-h, --help Display full help -d, --debug Turn on exeuction debugging reports -h, --no-host-prefix Does not prefix output lines with the host name -s, --show-commands Displays the command before the output report -n, --open-stdin Leaves stdin open when running (scary!) -l, --user USER SSH's to the host as user USER -r, --run-locally Run commands locally (replaces $host with host) -o, --self-remote Run locally instead of over SSH for local host -V, --version Report the version and exit
The idea behind this tool originally came from wanting to do something on each machine in our network. Existing scripts would serially go to each machine run the command, wait for it to finish, and continue to the next machine. There was no reason why this couldn't be done in parallel. The problems, however, were many. First of all, the output from finishing parallel jobs needs to be buffered in such a way that different machines wouldn't output their results on top of eachother. A final bit was added because it was nice to have output alphabetical rather than first-done, first-seen. The result is a parallel job spawner that displays output from the machines alphabetically, as soon as it is available. If ``alpha'' take longer than ``zebra'', there will be no output past ``alpha'' until it is finished. As soon as ``alpha'' is finished, though, everyone's output is printed.
Sending a SIGUSR1 to
gsh(1) will cause it to report which machines are
still pending. (Effectively turns on --debug for one cycle.)
gsh -r all 'echo $host'
perl(1), ghosts(1), ssh(1), SystemManagement::Ghosts(1)
Kees Cook <email@example.com>
Copyright (C) 1998-2006 Kees Cook <firstname.lastname@example.org>
Supposedly based on original code distributed with Perl Distribution.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Revision: $Revision $