[IRCServices] Rotate Log function - performance
Ian R. Justman
ianj at esper.net
Sat Mar 3 05:33:00 PST 2001
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.
-----
Ian R. Justman (NIC handle IJ12) ianj at esper.net (Official EsperNet business)
Co-Founder and Postmaster, The EsperNet IRC Network
Server Administrator, chocobo.esper.net "IJ" on IRC
PGP key available upon request, or finger ianj at esper.net.
If this message was signed with the Postmaster's key, please finger
postmaster at esper.net for the Postmaster public key.
Type Bits/KeyID Date User ID
pub 1024/BAB34B69 1997/11/15 EsperNet Postmaster <postmaster at esper.net>
Key fingerprint = 05 BD 7C B5 8E 0B FD EF EE 47 49 C4 96 11 59 75