Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] "New elog functionality" Log rotation?
Date: Sun, 18 Jun 2006 09:48:02
Message-Id: 358eca8f0606180241q7995973kb83fae049d337930@mail.gmail.com
In Reply to: Re: [gentoo-user] "New elog functionality" Log rotation? by Teresa and Dale
1 On 17/06/06, Teresa and Dale <teendale@×××××××××××××.com> wrote:
2 > Richard Broersma Jr wrote:
3 >
4 > >I was wondering if anyone could point me to the conf file to turn on log rotation for my
5 > >emerge.log.
6
7 > Here is a sample of the file:
8 >
9 > > /var/log/http-replicator.log {
10 > > size 10k
11 > > missingok
12 > > copytruncate
13 > > compress
14 > > }
15 >
16 >
17 > That is for http-replicator and the file is named the same. I guess the
18 > name doesn't matter really.
19
20 Well, the name has to reflect *exactly* the path and file you intend to rotate.
21
22 > I'm not sure but I think you need a cron job to run it to. Not real sure.
23
24 There's two entries in logrotate.conf, a generic one:
25 ==========================
26 # rotate log files weekly
27 #monthly
28 weekly
29 #daily
30 ==========================
31
32 and a per file one, e.g.:
33 ==========================
34 # when /var/log/user.log gets big
35 /var/log/user.log
36 {
37 rotate 1
38 monthly
39 size=1M
40 }
41 ==========================
42
43 Now, if you add logrotate in you /etc/make.conf it will be taken into
44 account when new apps are created and relevant files and entries will
45 be added in /etc/logrotate.d by those apps that are logrotate aware.
46 This is from mine:
47 ==========================
48 # ls -la /etc/logrotate.d
49 total 21
50 drwxr-xr-x 2 root root 184 Jun 4 12:37 .
51 drwxr-xr-x 73 root root 5144 Jun 18 10:38 ..
52 -rw-r--r-- 1 root root 0 Jan 21 02:33 .keep
53 -rw-r--r-- 1 root root 145 Feb 14 19:59 acpid
54 -rw-r--r-- 1 root root 79 May 6 12:13 hibernate-script
55 -rw-r----- 1 root root 191 Mar 2 20:26 privoxy
56 -rw-r--r-- 1 root root 342 Jan 22 20:21 syslog-ng
57 ==========================
58
59 Of course, if there is a file created for an application in
60 /etc/logrotate.d there's no need for a manual entry in
61 /etc/logrotate.conf as it will be a duplicate and lead to errors which
62 will invariably appear in /root/dead.letter.
63
64 HTH.
65 --
66 Regards,
67 Mick
68 --
69 gentoo-user@g.o mailing list