Gentoo Archives: gentoo-user

From: lee <lee@××××××××.de>
To: gentoo-user@l.g.o
Subject: [gentoo-user] logrotate: name of log file after it's rotated?
Date: Fri, 25 Mar 2016 11:46:42
Message-Id: 87wpoqlr02.fsf@heimdali.yagibdah.de
1 Hi,
2
3 is there a built-in way (like a place holder) to figure out what name a
4 rotated log file has been given by logrotate?
5
6 Here's what I'm trying to do:
7
8
9 ,---- [ cat /etc/logrotate.d/exim }
10 | /var/log/exim/exim*.log {
11 | daily
12 | missingok
13 | rotate 800
14 | compress
15 | delaycompress
16 | notifempty
17 | create 640 mail mail
18 | postrotate
19 | /usr/sbin/eximstats <name-of-rotated-file> | mail -s "eximstats" root
20 | endscript
21 | }
22 `----
23
24
25 I want <name-of-rotated-file> replaced with the name the log file that
26 has been rotated has been renamed to. I can think of ways to do this
27 otherwise, like writing a script that figures out the name of the file,
28 or using 'prerotate' instead.
29
30 It just won't make any sense if logrotate doesn't already have some kind
31 of place holder for this.

Replies

Subject Author
Re: [gentoo-user] logrotate: name of log file after it's rotated? Alan McKinnon <alan.mckinnon@×××××.com>