1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2//EN">
4 <TITLE> [IRCServices] Rotate Log function - performance
6 <LINK REL=
"Index" HREF=
"index.html" >
7 <LINK REL=
"made" HREF=
"mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20Rotate%20Log%20function%20-%20performance&In-Reply-To=Pine.LNX.4.21.0103021520370.294-100000%40vector.chocobo.org">
8 <META NAME=
"robots" CONTENT=
"index,nofollow">
9 <META http-equiv=
"Content-Type" content=
"text/html; charset=us-ascii">
10 <LINK REL=
"Previous" HREF=
"001540.html">
11 <LINK REL=
"Next" HREF=
"001547.html">
13 <BODY BGCOLOR=
"#ffffff">
14 <H1>[IRCServices] Rotate Log function - performance
</H1>
16 <A HREF=
"mailto:ircservices%40ircservices.za.net?Subject=%5BIRCServices%5D%20Rotate%20Log%20function%20-%20performance&In-Reply-To=Pine.LNX.4.21.0103021520370.294-100000%40vector.chocobo.org"
17 TITLE=
"[IRCServices] Rotate Log function - performance">orion at tribble.dyndns.org
19 <I>Sat Mar
3 04:
12:
01 PST
2001</I>
21 <LI>Previous message:
<A HREF=
"001540.html">[IRCServices] Rotate Log function - performance
23 <LI>Next message:
<A HREF=
"001547.html">[IRCServices] Rotate Log function - performance
25 <LI> <B>Messages sorted by:
</B>
26 <a href=
"date.html#1545">[ date ]
</a>
27 <a href=
"thread.html#1545">[ thread ]
</a>
28 <a href=
"subject.html#1545">[ subject ]
</a>
29 <a href=
"author.html#1545">[ author ]
</a>
34 <PRE>Ian R. Justman said:
35 ><i> As has been suggested, use SIGUSR2. Then let Cron deal with the
"per
36 </I>><i> second
" dickering to call a Perl/Python/Script/whatever script you may
37 </I>><i> write deal with the actual rotating.
39 </I>><i> As for precision, does the phrase,
"Measure with a micrometer, mark with
40 </I>><i> chalk, cut with an axe
" mean anything to you? I don't know about you, but
41 </I>><i> I frankly don't much care. Just as long as I can move logs out of the way
42 </I>><i> and keep my disk space somewhat manageable, that's all I ask.
44 </I>><i> I was the one who asked for this function. Mainly because it's MUCH
45 </I>><i> easier to set up a cron event than to try to remember to get my butt onto
46 </I>><i> IRC and issue the rotatelog command.
48 </I>><i> In fact, many systems use this kind functionality notably with system
49 </I>><i> logs, including most Linux distros as well as FreeBSD and possibly the
50 </I>><i> other BSDs as well. I figured something like this should be in Services
51 </I>><i> because the operating system already has tools which allow for periodic
52 </I>><i> scheduling; wny not use them? ;) Plus it's pretty simple to whip up a
53 </I>><i> rotating script in Perl or even shell script.
55 or just add a stanza to your logrotate.conf :)
57 /usr/local/lib/services/services.log {
58 daily # or 'weekly' if you prefer :)
59 rotate
14 # save
14 backups of logs
60 errors root # mail errors to root
61 compress # compress old logs
62 create
0600 user group # create an empty logfile with these permissions
63 # after rotating the old one out of the way
64 postrotate # execute these commands after rotating the logfiles
65 kill -SIGUSR2 `cat /usr/local/lib/services/services.pid`
69 Disclaimer: I haven't actually tried that. just whipped it up on the fly... still
70 using old services myself ;)
73 Orion orion [at] tribble [dot] dyndns [dot] org
75 Happiness isn't happiness
76 without a violin-playing goat
85 <LI>Previous message:
<A HREF=
"001540.html">[IRCServices] Rotate Log function - performance
87 <LI>Next message:
<A HREF=
"001547.html">[IRCServices] Rotate Log function - performance
89 <LI> <B>Messages sorted by:
</B>
90 <a href=
"date.html#1545">[ date ]
</a>
91 <a href=
"thread.html#1545">[ thread ]
</a>
92 <a href=
"subject.html#1545">[ subject ]
</a>
93 <a href=
"author.html#1545">[ author ]
</a>