]> jfr.im git - irc.git/blob - software/!RELEASES/ircservices/achurch.org/services/lists/ircservices/2001/001545.html
RELEASE -> !RELEASE
[irc.git] / software / !RELEASES / ircservices / achurch.org / services / lists / ircservices / 2001 / 001545.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
2 <HTML>
3 <HEAD>
4 <TITLE> [IRCServices] Rotate Log function - performance
5 </TITLE>
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">
12 </HEAD>
13 <BODY BGCOLOR="#ffffff">
14 <H1>[IRCServices] Rotate Log function - performance</H1>
15 <B>Orion</B>
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
18 </A><BR>
19 <I>Sat Mar 3 04:12:01 PST 2001</I>
20 <P><UL>
21 <LI>Previous message: <A HREF="001540.html">[IRCServices] Rotate Log function - performance
22 </A></li>
23 <LI>Next message: <A HREF="001547.html">[IRCServices] Rotate Log function - performance
24 </A></li>
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>
30 </LI>
31 </UL>
32 <HR>
33 <!--beginarticle-->
34 <PRE>Ian R. Justman said:
35 &gt;<i> As has been suggested, use SIGUSR2. Then let Cron deal with the &quot;per
36 </I>&gt;<i> second&quot; dickering to call a Perl/Python/Script/whatever script you may
37 </I>&gt;<i> write deal with the actual rotating.
38 </I>&gt;<i>
39 </I>&gt;<i> As for precision, does the phrase, &quot;Measure with a micrometer, mark with
40 </I>&gt;<i> chalk, cut with an axe&quot; mean anything to you? I don't know about you, but
41 </I>&gt;<i> I frankly don't much care. Just as long as I can move logs out of the way
42 </I>&gt;<i> and keep my disk space somewhat manageable, that's all I ask.
43 </I>&gt;<i>
44 </I>&gt;<i> I was the one who asked for this function. Mainly because it's MUCH
45 </I>&gt;<i> easier to set up a cron event than to try to remember to get my butt onto
46 </I>&gt;<i> IRC and issue the rotatelog command.
47 </I>&gt;<i>
48 </I>&gt;<i> In fact, many systems use this kind functionality notably with system
49 </I>&gt;<i> logs, including most Linux distros as well as FreeBSD and possibly the
50 </I>&gt;<i> other BSDs as well. I figured something like this should be in Services
51 </I>&gt;<i> because the operating system already has tools which allow for periodic
52 </I>&gt;<i> scheduling; wny not use them? ;) Plus it's pretty simple to whip up a
53 </I>&gt;<i> rotating script in Perl or even shell script.
54 </I>
55 or just add a stanza to your logrotate.conf :)
56
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`
66 endscript
67 }
68
69 Disclaimer: I haven't actually tried that. just whipped it up on the fly... still
70 using old services myself ;)
71
72 --
73 Orion orion [at] tribble [dot] dyndns [dot] org
74
75 Happiness isn't happiness
76 without a violin-playing goat
77
78
79 </PRE>
80
81 <!--endarticle-->
82 <HR>
83 <P><UL>
84 <!--threads-->
85 <LI>Previous message: <A HREF="001540.html">[IRCServices] Rotate Log function - performance
86 </A></li>
87 <LI>Next message: <A HREF="001547.html">[IRCServices] Rotate Log function - performance
88 </A></li>
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>
94 </LI>
95 </UL>
96
97 </body></html>