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. :)
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||