Enables to copy files to many hosts
tomahawk-rsync [options] source destination
tomahawk-rsync is a program that enables to copy files <into/from> many hosts.
$ tomahawk-rsync -h host1,host2,host3 test.py /tmp/test.py
---> 'test.py' is copied to host1, host2 and host3.
$ tomahawk-rsync -f web.list /usr/local/apache2/conf/httpd.conf /tmp/httpd.conf
---> 'httpd.conf' is copied to hosts which listed in 'web.list'.
$ tomahawk-rsync -h host1,host2 -m pull /usr/local/apache2/conf/httpd.conf /tmp/conf/
---> 'httpd.conf' is copied from host1 and host2 to local directory /tmp/conf as 'host1__httpd.conf' and 'host2__httpd.conf'.
tomahawk-rsync copies files via 'rsync'. You can specify options for rsync with -o/--rsync-ooptions.
These programs follow the usual GNU command line syntax, with long options starting with two dashes ('--'). A summary of options is included below. For a complete description, see the Info files.
Specifies host names for sending commands. You can specify multiple hosts with ','.
Specifies hosts files which listed host names for sending commands. You can specify multiple hosts files with ','.
Format of hosts file is below.
web01 web02 #web03 web04
A line of starting with '#' disables a host.
Prompts a password for ssh authentication of rsync at first. If the password is all the same between target hosts, you'll input a password just once.
Continues to send commands even if any errors. The default behavior is fail-safe, means that tomahawk will stop if any errors.
Specifies a number of processes for parallel command execution. (default: 1) If your machine has many cpu cores, --parallel 2 .. N might be faster.
Specifies timeout seconds for a command.
Specifies command output format. The default is '${user}@${host} % ${command}n${output}n'
Specifies rsync user. The default is a current logged in user.
Specifies rsync options. The default is '-av'
Selection of 'push' or 'pull'. 'pull' means copy files from remote to local. The default is 'push'.
Specifies configuration file path. For additional information, see omit-command-line-options
tomahawk's behavior is affected by the following environment variables.
This variable specifies an environment of 'production', 'testing' or 'development'. If TOMAHAWK_ENV=production specified, tomahawk or tomahawk-rsync prompt as "command "%s" will be executed %s hosts. Are you sure? [yes/NO]: ". The environment variable exists for mis-execution of a command.
ssh(1)
Kazuhiro Oinuma, Kohei Maeda
2011-2014, Kazuhiro Oinuma