[TriLUG] Re: tail across logrotate

James Manning trilug at sublogic.com
Thu Mar 21 13:59:02 EST 2002


[M. Mueller at Signalnetware.com]
> I want to "tail -f /var/log/myfile &" for weeks at a time.  I also logrotate 
> /var/log/myfile on a daily basis.  When I logrotate, the file handle changes 
> and the tail no longer works.  I am manually killing/restarting the tail 
> process on a daily basis which is tedious since I do this to 5+ systems per 
> day.
> 
> Any hints on how to automate or otherwise improve this process would be most 
> appreciated.

Oh, and if you're free to modify the logrotate conf and the daemon
can be down for a few seconds, you can copy the log, truncate the file
(cp /dev/null file or whatever) and start the daemon and tail will just
note that the file got truncated and keep truckin

I'd imagine this is more hassle than its worth in maintaining custom
logrotate conf's, but it's another option
-- 
James Manning <jmm at sublogic.com>
GPG Key fingerprint = B913 2FBD 14A9 CE18 B2B7  9C8E A0BF B026 EEBB F6E4



More information about the TriLUG mailing list