in reply to File::Tail with top fill logs

File::Tail does exactly what I need except when the log reaches it's max size setting and start top filling.

What is "it's max size"? I guess you're not filling the filesystem. I guess that you have some program that writes to the log and when it has reached some critical size either in bytes or lines or whatever, starts writing into it from the beginning. It would be interesting to know if it just rewinds it (as with Perl's seek) or if it closes it and opens it again. Without knowing, you may try monitoring the file for size changes or access time modification or something like that.

Replies are listed 'Best First'.
Re^2: File::Tail with top fill logs
by boat73 (Scribe) on Oct 12, 2006 at 14:46 UTC
    Good suggestions, but when the file reaches it's max size inm bytes the file mod time does not change nor does the size. It does create a backup and I can scan that every time it's modtime changes, but I was hoping for something more realtime.
      Hmmm. I'm chasing the same problem, I think. Are you working on Windows Schedlgu.txt (task scheduler) log file?
        I'm considering a few options
      1. Brute force solution -- delete the file after each check. If I need to keep the data, write it off to another file.
      2. The lazy admin solution -- Have Windows notify you when Task Scheduler can't run a task. See http://support.microsoft.com/kb/308558. Of course, this requires faith that Windows will actually do what it says it will.
      3. The whole thing solution -- check the whole file for failure s each time. One of the end users I'm supporting suggested this.
      4. Time and date solution. Look for the appropriate time and date a task should run and get the matching log entry.
      5. Perl Watchmaker's solution. Use Win32::TaskScheduler. Very fine-grained control. Do you need that much?
        Sorry, Not working on the same issue, but I have used Win32::TaskScheduler and it is great.