diff --git a/TODO b/TODO index 54fe779..455689b 100644 --- a/TODO +++ b/TODO @@ -21,6 +21,9 @@ - Option to read from stdin +- -H and hostlist files are now additive + + diff --git a/tsshbatch.rst b/tsshbatch.rst index 0c1dddd..3f574c3 100644 --- a/tsshbatch.rst +++ b/tsshbatch.rst @@ -8,7 +8,7 @@ SYNOPSIS -------- -tsshbatch.py [-Nehvk] [-n name] [-p pw] [-H 'h1 h2 ...' | hostlistfile] command arg ... +tsshbatch.py [-Nehvk] [-n name] [-p pw] [-H 'h1 h2 ...' | hostlistfile] [command arg ... | -] DESCRIPTION @@ -19,6 +19,9 @@ scripts, this overcomes the ``ssh`` limitation of not being able to specify the password on the command line. +You can also use ``tsshbatch`` to ``GET`` and ``PUT`` files +from- and to many hosts at once. + ``tsshbatch`` also understands basic ``sudo`` syntax and can be used to access a host, ``sudo`` a command, and then exit. @@ -82,6 +85,36 @@ -v Print detailed program version information and exit +The last option on the command line is either an explicit command +string or the ``-``. If you provide an explicit command, +``tsshbatch`` will attempt to execute it on every host you've +specified either via ``-H`` or a ``hostlistfile``:: + + tsshbatch.py -Hmyhost ls -al /etc + +This will do a ``ls -al /etc`` on ``myhost``. + +Be careful when using metacharacters like ``&&, <<, >>, <, >`` and so +on in your commands. You have to escape and quote them properly or +your local shell will interfere with them being properly conveyed to +the remote machine. + +If ``tsshbatch`` sees a ``-`` character, it will read commands to +execute from stdin. This is the preferred way of doing multiple +commands in a single run of ``tsshbatch``:: + + tsshbatch.py .....