configure batch to sent minute info instead of entire stdout
Posted
by Daniel
on Stack Overflow
See other posts from Stack Overflow
or by Daniel
Published on 2010-03-18T10:17:06Z
Indexed on
2010/03/18
10:21 UTC
Read the original article
Hit count: 511
Hi all,
I am working on a RedHat server along with several other users. We use the batch
utility to set a job queue. Some of the programs that I use write stuff to stdout during the run, with info on who much data has been processed to far and estimated time until completion etc.
batch -q z
at> myScript -i somefile -o someotherfile
By default, the batch
util send an email to me (since I configured it using .forward
) with the entire output from stdout. Since the scripts writes something to stdout a few times each second, the amount of log-stuff I get from a two-day script can be ˜20 Mbs. Clearly not what I want. I can of course pipe stdout to a file like so
batch -q z
at> myScript -i somefile -o someotherfile > myscript.stdout.log
but then I get a blank e-mail from the util.
So to my question: Is it possible to configure batch so that it sends time the job started and ended, or run time or some oth valuable information to me, instead of a 20 Mb mail or a blank mail?
Note that the scripts that I use are binaries and I cannot customize the code to output less info in the first place (which would be the optimal solution I guess).
Thanks
/Daniel
© Stack Overflow or respective owner