Re: logrotate schluckt gewünschte Konfiguration nicht
* Thomas Klein <mailinglist@skynetworks.de> wrote:
> >Gib es Einträge in syslog, messages und/oder des MTA während
> >der logrotate Ausführung durch cron?
>
> Eigentlich nur in /var/log/messages:
> May 26 00:03:59 localhost syslogd 1.4.1#17: restart (remote reception).
>
> Das ist immer nach der Rotation der erste Eintrag.
>
> Hab aber glaube ich den schuldigen gefunden:
>
> Mailgate:/etc# syslogd-listfiles
> /var/log/messages
> /var/log/syslog
> /home/brickreporter/router.log
> /var/log/mail.log
> /var/log/mail.info
>
>
> So wie ich das verstehe, gibt dieses command die logfiles an, die täglich
> rotiert werden, da sind ja auch meine beiden files dabei, bei denen das
> eigentlich nicht so sein soll.
> Schätze mal, dass ich da ansetzen muss... Wie bringe ich denn logrotate
> bzw. syslogd dazu, mail.log und router.log nicht in diesem täglichen
> Prozess zu rotieren?
Indem du in /etc/cron.daily/sysklogd angibst, das diese Files nicht von
diesem Skript rotiert werden sollen.
Ändere die Zeile
"for LOG in `syslogd-listfiles`" zB. nach for LOG in "`syslogd-listfiles -s
"mail.*"`"
,----[ /etc/cron.daily/sysklogd ]-
| #! /bin/sh
|
| # sysklogd Cron script to rotate system log files daily.
| #
| # If you want to rotate other logfiles daily, edit
| # this script. An easy way is to add files manually,
| # to add -a (for all log files) to syslogd-listfiles and
| # add some grep stuff, or use the -s pattern argument to
| # specify files that must not be listed.
`----
Und anstatt die logrotate.conf zu editieren könntest du dir der
Übersicht wegen für deine Logs einzelne Dateien in /etc/logrotate.d
anlegen.
Gruß
Jens
Reply to: