parallel --spreadstdin --line-buffered 'some_command 2 \
mktemp --tmpdir /tmp/stderr
' | do_something && if [test -s /tmp/stderr]; then; sleep .1; else; rm /tmp/stderr
- One-Liner to Test if File Exists and Size is Greater than Zero for TRUE; empty if FALSE.
I.T. is about doing something that works. Stop counting your bits and bytes, and create an inotifywait trigger on startup to check your logs if empty, record results to datatable, and wipe log on complete; then program a web interface that emails you when keywords appear in your error log.
while:
do
inotifywait -e create /tmp/* && \
if [ -s /tmp/stderr ]
then
##put it in a datatable
##remove the log
fi
done
iNotifyWait can also monitor Kernel F/S subsystem to see if a file is changed, if you are appending. Otherwise, modify the Source Code and recompile to prevent the error from being created by modifying the try() catch() or error reporting section (the part that prints error codes to the screen).