[IRCServices] Rotate Log function - performance
Orion
orion at tribble.dyndns.org
Sat Mar 3 07:26:01 PST 2001
Ian R. Justman said:
> On Fri, 2 Mar 2001, Orion wrote:
>
> > or just add a stanza to your logrotate.conf :)
> >
> > /usr/local/lib/services/services.log {
> > daily # or 'weekly' if you prefer :)
> > rotate 14 # save 14 backups of logs
> > errors root # mail errors to root
> > compress # compress old logs
> > create 0600 user group # create an empty logfile with these permissions
> > # after rotating the old one out of the way
> > postrotate # execute these commands after rotating the logfiles
> > kill -SIGUSR2 `cat /usr/local/lib/services/services.pid`
> > endscript
> > }
> >
> > Disclaimer: I haven't actually tried that. just whipped it up on the fly... still
> > using old services myself ;)
>
> There's no need to create a new file. All you need do is rename the
> current logfile, then SIGUSR2 Services. If the services.log file is not
> already there (which we will assume is fact after renaming it using "mv
> services.log (whatever)"), it'll create a new one for you.
>
> That's just an extra step you don't need to do.
>
> --Ian R. Justman, Co-Founder and Postmaster, The EsperNet IRC Network.
I couldn't remember if services created the log itself, or if (like some
ircds) it needed to be created before it was used. My services log is
about 300k after 6 months. Not heavily used, so i've never tried it :)
--
Orion orion [at] tribble [dot] dyndns [dot] org
<bucko_away> t&r in about 5 too
<Noser> 5 hours? you must have missed some of the subtlety in the art.