Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^4: Man, File::Tail is just beating me down!

by hallikpapa (Scribe)
on Jan 18, 2008 at 19:12 UTC ( #663119=note: print w/replies, xml ) Need Help??

in reply to Re^3: Man, File::Tail is just beating me down!
in thread Man, File::Tail is just beating me down!

Originally it showed in the log on the client. There is a sequence number in each record that the process watches. If the sequence number was less than the current one, it figured it was a restart. printed to the log what the previous sequence number was, and the current one, and over and over everytime it got to that warning in the log, the sequence number was from the first record in the file. In my original post I put the logic to watch for a restart so it wouldn't try and stream all that data. that had been processed already. That code in the original post is almost the whole script minus the Socket connection. First the script receives the last record inserted into the database, creates the file::tail instance, then starts processing the log file and doesn't start streaming records until it gets to last line inserted. I guess that was a long winded way of saying everything is in the original post of this thread. I am convinced that one of the options I set here
$file=File::Tail->new(name=>$filename, maxinterval=>5, interval=>1, ta +il=>-1, ignore_nonexistant => 1, errmode=>\&do_exit);
has something in it's subroutine that causes a restart when I don't want one. It also looks like he does some sort of seek? Maybe to find where it left off? That would be cool to jump straight to where it left off by tracking the bytes. :)

Replies are listed 'Best First'.
Re^5: Man, File::Tail is just beating me down!
by starbolin (Hermit) on Jan 19, 2008 at 00:22 UTC

    Tail is not restarting. It is reopening the file and the dumping the file again as per the default setting of reset_tail. Set reset_tail to 0 to not receive the whole file each time there is a pause in the logs.

    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://663119]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2020-10-24 19:42 GMT
Find Nodes?
    Voting Booth?
    My favourite web site is:

    Results (246 votes). Check out past polls.