diff --git a/TODO b/TODO index aa4e3d5..0fd8060 100644 --- a/TODO +++ b/TODO @@ -4,7 +4,9 @@ [CHANGES] -- +- The -H option can now appear on the command line multiple times + thereby creating an aggregate list of all hosts named therein. + [BUG FIXES] - @@ -13,8 +15,6 @@ TODO ---- -- Allow -H to aggregate - - Make hostlist -i ... and allow multiple ones thereof - Make file xfer noise go away with -s @@ -46,9 +46,3 @@ - Write the server noise, as it appears to stderr for debug purposes - Note in docs: In this mode it will HANG waiting for interactive input. - Note in docs: There is no separation between stdout and sterr in this mode - - - - - - diff --git a/tsshbatch.py b/tsshbatch.py index 6e11258..4f62c46 100755 --- a/tsshbatch.py +++ b/tsshbatch.py @@ -847,7 +847,7 @@ ProcessTXRQ(val, Get_Transfer_List) if opt == "-H": - Hosts = val.split() + Hosts += val.split() if opt == "-N": PROMPTUSERNAME = True diff --git a/tsshbatch.rst b/tsshbatch.rst index 0c5e7fb..f362afc 100644 --- a/tsshbatch.rst +++ b/tsshbatch.rst @@ -63,8 +63,8 @@ statistics. This does not include any time spent for interactive prompting and response, but reflects actual program runtime. (Default: Off) - - + + -C configfile Specify the location of the ssh configuration file. (Default: ``~/.ssh/config``) @@ -87,7 +87,7 @@ ``spec`` is a quoted pair of strings. The first specifies the path of the source file (on the remote machine) to copy. The second, specifies - the destination *directory* (on the local + the destination *directory* (on the local machine):: tsshbatch.py -G "/foo/bar/baz /tmp" hostlist @@ -104,9 +104,13 @@ be enclosed in *quotes* so that the list of hosts is handed to the -H option as a single argument:: - -H 'host1 host2 host3' + -H 'host1 host2 host3' - -N Force interactive username dialog. This cancels + This option may appear on the command line multiple + times. The hosts will be processed in the order + in which they appeared on the command line. + + -N Force interactive username dialog. This cancels any previous request for key exchange authentication. -P spec PUT file from local machine to remote machine destination @@ -136,7 +140,7 @@ ``sudo`` is either improperly configured on some hosts or has a different password. This can also be used to discover where ``sudo`` does- and does not work correctly. - + -e Don't report remote host ``stderr`` output. -f cmdfile Read commands from a file. This file can be commented @@ -176,11 +180,11 @@ you're ready to actually run commands, you can override it with ``-x`` on the command line. - -y Turn on 'noisy' reporting for additional detail on + -y Turn on 'noisy' reporting for additional detail on every line, instead of just at the top of the - ``stdout`` and ``stderr`` reporting. This is + ``stdout`` and ``stderr`` reporting. This is helpful when you are filtering the output through - something like ``grep`` that only returns matching + something like ``grep`` that only returns matching lines and thus no context information. Turns off ``-q``. @@ -270,7 +274,7 @@ Notice that the list of hosts must be separated by spaces but passed as a *single argument*. Hence we enclose them in single quotes. - + - Via a host list file:: tsshbatch.py myhosts df -Ph @@ -374,7 +378,7 @@ 3) Make sure you don't leave a logged in session unlocked so that other users could walk up and see your password by displaying the environment. - + This approach is best when you want your login credentials available for the duration of an *entire login session*. @@ -494,7 +498,7 @@ If you try to use Key Exchange and ``tsshbatch`` detects a command beginning with ``sudo``, it will prompt you for a password anyway. This is because ``sudo`` requires a password to promote privilege. - + File Transfers ============== @@ -690,7 +694,7 @@ You can just define variable like this:: - .define __MYCMD__ = myfinecommand -X -Y -x because this is a really long string + .define __MYCMD__ = myfinecommand -X -Y -x because this is a really long string From then on, instead of typing in that long command on the command line or in a command file, you can just use ``__MYCMD__`` and ``tsshbatch`` will substitute @@ -760,7 +764,7 @@ ========================================== User Defined and Execution Variables are defined in either a -``hostlistfile`` or ``cmdfile``. +``hostlistfile`` or ``cmdfile``. Builtin Variables are defined within ``tsshbatch`` itself unless you override them. @@ -917,7 +921,7 @@ output - which is also multiline. This gets to be obnonxious pretty quickly. You can make a lot of this go away with the ``-q``, or "quiet" option. - + .. NOTE:: It's important to remember that the program you are invoking *runs on the same machine as* ``tsshbatch`` *itself*, NOT each host you are sending commands to. In other words, just @@ -1039,7 +1043,7 @@ ``ls -l`` is reported like this:: ---> myhost: SUCCESS: Connection Established - ---> myhost (stdout) [ls -l]: + ---> myhost (stdout) [ls -l]: ... ---> myhost (stderr) [ls -l]: @@ -1055,20 +1059,20 @@ suppress echoing these long commands for each and every host in your list. -``-y`` or "noisy" mode, produces normal output noise but +``-y`` or "noisy" mode, produces normal output noise but also replicates the hostname and command string *for every line of output produced*. For instance, ``ls -1`` might normally produce this:: ---> myhost: SUCCESS: Connection Established - ---> myhost (stdout) [ls -1]: + ---> myhost (stdout) [ls -1]: backups bin But in noisy mode, you see this:: - ---> myhost: SUCCESS: Connection Established ---> myhost (stdout) [ls -1]: + ---> myhost: SUCCESS: Connection Established ---> myhost (stdout) [ls -1]: [myhost (stdout) [ls -1]] backups [myhost (stdout) [ls -1]] bin