procmail
[Top] [All Lists]

Procmail log w/root-tail

2000-01-20 21:08:54
  I have a situation where I view the entries to the logfile for procmail
within a root-tail window on my screen, I'm sure many of you are familiar
with this. Anyway, I have mailstat run every 8 hours within my personal
crontab and have noticed the following.
  When mailstat runs on the logfile, it moves the original to 'log.old'
and creates a new 'log' file within the same directory, the problem is
that root-tail is still linked to the original logfile which is now called
'log.old'. What I mean by this is, when new entries are added to 'log'
root-tail no longer aknowledges these entries, but if you add something to
the original file, 'log.old' the new entries will show up in the root-tail
window.
  I have come up with a routine that will create a master and base file
based off of the logfile (log, .log and log.base) which won't affect the
workings of root-tail on the original log file. I run a diff/patch on
log and .log to create log.base which mailstat uses, works pretty good for
a quick hack.
  Anyway, this option will cause the original logfile to slowly grow over
time, becoming quite large eventually if not looked after. So what I'm
wondering is:

1. When would be a good time to have the logfile flushed so that size
   doesn't become a factor?

  I thought of running a diff/patch against the two log files when the
user logs into X so that no entries are lost, but I usually leave the X
session running 24/7 with the system which leads to..

2. Does anyone have a better idea of when this can be accomplished?

3. Has anyone else come across this situation before? and if so, how was
   it overcome if at all?

  Maybe a way to relink root-tail to the original logfile, or a way to
prevent mailstat from making the file link change when it runs.

-- 
        S.Toms - tomas(_at_)primenet(_dot_)com - homepage is in the works
                   SuSE Linux v6.2+ - Kernel 2.2.13

Genetics explains why you look like your father, and if you don't, why
you should.

<Prev in Thread] Current Thread [Next in Thread>