Keep It Simple, Stupid | |
PerlMonks |
Re: Tail'ing a log that frequently rolls overby hbm (Hermit) |
on Jan 15, 2009 at 16:54 UTC ( [id://736586]=note: print w/replies, xml ) | Need Help?? |
I've been tail'ing this thread with great interest! I currently monitor a log with this daemon. Notable differences from OP's environment - I'm on Unix and I rotate the log myself, monthly.
This works pretty well for me. On the downside, it quietly stops working if the log is truncated or created anew. But I work around that by HUP'ing it after I rotate the log. But hello, -F! (Who knew about it? Not my, um, man tail.) So I've tried this:
This seems a bit more succinct; and it gracefully handles a truncated or recreated file. A downside, perhaps, is that it creates a second process; but more importantly if I kill the daemon, the tail process doesn't receive the signal until the log is next written-to. Any thoughts on getting my original daemon to internally handle the truncated/recreated log? Or how the second daemon can kill the tail -F immediately?
In Section
Seekers of Perl Wisdom
|
|