in reply to Re: Tail'ing a log that frequently rolls over
in thread Tail'ing a log that frequently rolls over

You could try this:

use strict; use warnings; use POSIX; use Perl::Unsafe::Signals; my $appLog = '/tmp/t.txt'; my $error = 'Fatal Error'; exit if (my $pid = fork); defined($pid) or die "Can't fork: $!"; POSIX:setsid() or die "Can't setsid: $!"; my $tail = open(LOG,"/usr/local/bin/tail -F $appLog|") or die "Can't tail: $!"; $SIG{INT} = sub { close LOG; kill 3, $tail; exit; }; $SIG{TERM} = $SIG{INT}; $SIG{PIPE} = 'IGNORE'; $SIG{HUP} = 'IGNORE'; UNSAFE_SIGNALS { while (<LOG>) { #&pageMe if /$error/; print; } };

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

Replies are listed 'Best First'.
Re^3: Tail'ing a log that frequently rolls over
by hbm (Hermit) on Jan 15, 2009 at 18:43 UTC
    Some day, but I'm stalled at Perl 5.8.0 and it requires 5.8.1. Thanks for all your suggestions on this topic!