Re: Syslogrotation beißt Logrotation
Hi,
On Oct 11, Dennis Brandenburg wrote:
>
> laut /var/lib/logrotate/status ist die access_log zuletzt am 2.9. Rotiert worden:
>
> ...
> "/var/log/apache2/access_log" 2006-9-2
> ...
>
Also denkt logrotate seit Oktober, daß die Logfiles länger als 4 Wochen
nicht rotiert wurden. Deshalb will logrotate täglich rotieren - weil
der Zeitstempel nicht aktualisiert wird und "monthly" zutrifft.
>
> lofrotate.d -d /etc/logrotate.conf ergab folgendes Ergebnis (Auszug):
>
> ----schnipp----
> rotating pattern: "/var/log/apache2/error.log" monthly (4 rotations)
> empty log files are rotated, old logs are removed
> considering log /var/log/apache2/error.log
> log needs rotating
> rotating log /var/log/apache2/error.log, log->rotateCount is 4
[..]
> renaming /var/log/apache2/error.log to /var/log/apache2/error.log.1
> running postrotate script
> running script with arg /var/log/apache2/error.log: "
> /etc/init.d/apache reload > /dev/null
> "
> error: unable to open /var/log/apache2/error.log.1 for compression
>
> ----schnapp----
Ich weiß nicht, wie logrotate sich verhält, wenn ein Fehler auftritt
(siehe die mit "error" beginnende Zeile), aber ich würde zunächst
einmal versuchen, diesen zu beheben.
Gibt es die denn die Datei error.log.1 oder heisst die schon
error.log.1.gz ?
/etc/logrotate.d/apache sieht unter sarge bei mir übrigens so aus:
/var/log/apache/*.log {
weekly
missingok
rotate 52
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
postrotate
if [ -f /var/run/apache.pid ]; then \
if [ -x /usr/sbin/invoke-rc.d ]; then \
invoke-rc.d apache reload > /dev/null; \
else \
/etc/init.d/apache reload > /dev/null; \
fi; \
fi;
endscript
}
Das delaycompress sorgt dafür, daß die zuletzt rotierte Datei nicht komprimiert wird, und somit error.log.1 heissen müsste.
Wie sich bei dir das
noolddir
nocreate
[...]
olddir /var/log/old
create
verhält ist mir auch nicht ganz klar.
Wo kommen diese Einstellungen denn her?
Gruß, Andreas
Reply to: