Well, you could always create a separate diagnostics log
file and use a different "monitor" script that simply
monitors the size of the diagnostics file and then
tails/echoes any new lines when detected to the screen.
I have a script that does this for my backup job stream.
When the backup job kicks off it appends whatever is in the
daily log file, to the cumulative log file, deletes the
daily log, kicks off the monitor job to run in the
background and appends any new output to the daily log
file. The monitor job echoes everything that is appended to
the daily log file to the screen. It even repeats the last
line periodically so that the operators can see if
something is hung or not. In my case though, the monitor
job only runs as long as its parent job is running. But if
the terminal session hangs/dies/whatever the log file still
has all the diagnostics.
If you like, I could post both backup and monitor scripts,
so you could see how they interact.
If the code and the comments disagree, then both are probably wrong. -- Norm Schryer
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.