diff --git a/tsshbatch.rst b/tsshbatch.rst index 16abd02..c99dda3 100644 --- a/tsshbatch.rst +++ b/tsshbatch.rst @@ -136,6 +136,10 @@ -q Quiet mode - produce less noisy output. Turns off ``-y``. + -s Silence all program noise - only return command output. + Applies only to command operations. File transfer + and error reporting, generally, are unaffected. + -t Test mode: Only show what *would* be done but don't actually do it. This also prints diagnostic information about any variable definitions, the list @@ -942,6 +946,98 @@ preconfigured values of ``HOSTNAME`` and ``HOSTSHORT``. +Noise Levels +============ + +``tsshbatch`` defaults to a medium level of reporting as it runs. +This includes connection reporting, headers describing the command +being run on every host,and the results written to ``stdin`` and +``stdout``. Each line of reporting output begins with ``--->`` to +help you parse through the output if you happen to be writing a +program that post-processes the results from ``tsshbatch``. + +This output "noise" is judged to be right for most applications of the +program. There are times, however, when you want more- or less +"noise" in the output. There are several ``tsshbatch`` options that +support this. + +These options *only affect reporting of +commands you're running*. They do not change the output of file +transfer operations. They also do not change error reporting, which +is always the same irrespective of current noise level setting. + +``-q`` or "quiet" mode, reduces the amount of output noise in +two ways. First, it silences reporting each time a successful +connection is made to a host. Secondly, the command being run +isn't reported in the header. For example, normally, running +``ls -l`` is reported like this:: + + ---> myhost: SUCCESS: Connection Established + ---> myhost (stdout) [ls -l]: + ... + ---> myhost (stderr) [ls -l]: + +In quiet mode, reporting looks like this:: + + ---> localhost (stdout): + ... + ---> localhost (stderr): + +The main reason for this is that some commands can be very long. +With execution variables, it's possible to create commands that +span many lines. The quiet option gives you the ability to +suppress echoing these long commands for each and every host +in your list. + +``-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]: + + backups + bin + +But in noisy mode, you see this:: + + ---> myhost: SUCCESS: Connection Established ---> myhost (stdout) [ls -1]: + [myhost (stdout) [ls -1]] backups + [myhost (stdout) [ls -1]] bin + +Again, the purpose here is to support post-processing where you might +want to search through a large amount of output looking only for +results from particular hosts or commands. + +``-s`` or "silent" mode returns *only the results from running the +commands*. No headers or descriptive information are produced. It's +more-or-less what you'd see if you logged into the host and ran the +command interactively. For instance, ``ls -l`` might look like this:: + + total 44 + drwxr-xr-x 2 splot splot 4096 Nov 5 14:54 Desktop + drwxrwxr-x 39 splot splot 4096 Sep 9 14:57 Dev + drwxr-xr-x 3 splot splot 4096 Jun 14 2012 Documents + + +The idea here is to use silent mode with the various variables +described previously to customize your own reporting output. Imagine +you have this in a ``cmdfile`` and you run ``tsshbatch`` in silent +mode:: + + .define __USER__ = ! echo $USER + echo "Run on __HOSTNAME__ on __DATE__ at __TIME__ by __USER__" + uname -a + +You'd see output along these lines:: + + Run on myhost on 20991208 at 141659 by splot + Linux myhost 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux + + + + OTHER ----- @@ -1056,7 +1152,7 @@ :: - $Id: tsshbatch.rst,v 1.157 2014/12/08 15:50:42 tundra Exp $ + $Id: tsshbatch.rst,v 1.158 2014/12/08 20:26:55 tundra Exp $ This document was produced with ``emacs``, ``RestructuredText``, and ``TeX Live``.