This sounds like a logrotate problem.
Do you have logrotate controlling this log file.
I may be wrong, but I think if you have the file open when logrotate
kicks in, you filehandle will stay on the same file. i.e.
you open /var/log/maillog
logrotate removes /var/log/maillog.4
it then renames 3
On Thu, May 24, 2001 at 02:37:18PM -0400, Craig Moynes/Markham/IBM wrote:
>
> This is a problem with tail that I have run into as well.
>
> If the file size gets reset the stored location of EOF remains the same
> which is a problem. As the file is written too the size is still below that
> of w
Is there another way I should be approaching this task?
How about not using tail? I'm just ripping this off from the 'Perl
Cookbook' but:
for (;;) { #ever and ever
while ()
# Do your thing
}
sleep $awhile;
This is a problem with tail that I have run into as well.
If the file size gets reset the stored location of EOF remains the same
which is a problem. As the file is written too the size is still below that
of what tail is looking at. You can add a stat check to watch filesize and
reset the coun