Gentoo Archives: gentoo-user

From: Matthias Guede <matthias.guede@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] logrotate desn't create new empty files
Date: Fri, 03 Aug 2007 14:53:20
Message-Id: 50ba04d20708030747w352c45a3t5997d1c8102b8eac@mail.gmail.com
In Reply to: [gentoo-user] logrotate desn't create new empty files by Jakob
1 2007/8/3, Jakob <jak.gentoo@××××××××××.com>:
2 > Hi all,
3 >
4 > I'm running logrotate on my homeserver and the logs are rotated
5 > correctly but after rotating it should create new empty log files and
6 > that doesnt work.
7 >
8 > here are my confs:
9 > /etc/logrotate.conf:
10 > # $Header: /var/cvsroot/gentoo-x86/app-admin/logrotate/files/logrotate.conf,v
11 > 1.2 2004/07/18 01:58:24 dragonheart Exp $
12 > #
13 > # Logrotate default configuration file for Gentoo Linux
14 > #
15 > # See "man logrotate" for details
16 >
17 > # rotate log files weekly
18 > weekly
19 > #daily
20 >
21 > # keep 4 weeks worth of backlogs
22 > rotate 10
23 >
24 > # create new (empty) log files after rotating old ones
25 > create
26 >
27 > # uncomment this if you want your log files compressed
28 > compress
29 >
30 > # packages can drop log rotation information into this directory
31 > include /etc/logrotate.d
32 >
33 > notifempty
34 > nomail
35 > noolddir
36 >
37 > # no packages own lastlog or wtmp -- we'll rotate them here
38 > /var/log/wtmp {
39 > monthly
40 > create 0664 root utmp
41 > rotate 1
42 > }
43 >
44 > # system-specific logs may be also be configured here.
45 >
46 > and /etc/logrotate.d/syslog-ng:
47 > # $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/syslog-ng.logrotate,v
48 > 1.2 2004/07/18 02:25:02 dragonheart Exp $
49 > #
50 > # Syslog-ng logrotate snippet for Gentoo Linux
51 > # contributed by Michael Sterrett
52 > #
53 >
54 > /var/log/messages {
55 > dateext
56 > olddir /var/log/
57 > copy
58 > create 0600 root root
59 > size 5000k
60 > sharedscripts
61 > postrotate
62 > /etc/init.d/syslog-ng reload > /dev/null 2>&1 || true
63 > endscript
64 > }
65 >
66 > I thought create will do this but it doesn't work and my logs getting
67 > bigger and bigger.
68 > What did I do wron?
69 >
70 > Regards
71 >
72 > Jakob
73 > --
74 > gentoo-user@g.o mailing list
75 >
76 >
77
78 from LOGROTATE(8):
79
80 Here is more information on the directives which may be included in a
81 logrotate configuration file:
82
83 [...]
84
85 copy Make a copy of the log file, but don't change the original at
86 all. This option can be used, for instance, to make a snapshot
87 of the current log file, or when some other utility needs to
88 truncate or pare the file. When this option is used, the create
89 option will have no effect, as the old log file stays in place.
90 --
91 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] logrotate desn't create new empty files Jakob <jak.gentoo@××××××××××.com>