Logrotate rotiert nicht
Hi,
um es vorweg zu nehmen, ich stehe kurz vorm Nervenzusammenbruch.
Ich dachte eigentlich, ich bin langsam soweit um einfachste Vorgänge
unter Linux und vor allem Debian zu verstehen; scheinbar ein völliger
Trugschluß!
Ich habe folgende (Beispiel-) Konfigdatei für Logrotate:
cat /etc/logrotate.d/apache2
/var/log/apache2/*.log {
daily
missingok
rotate 4
start 0
compress
delaycompress
notifempty
create 640 root adm
sharedscripts
#olddir /var/log/logarchiv/apache2
postrotate
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
endscript
}
Die wird auch genutzt:
/usr/sbin/logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apache2
reading config info for /var/log/apache2/*.log
reading config info for /var/log/wtmp
reading config info for /var/log/btmp
Handling 3 logs
rotating pattern: /var/log/apache2/*.log after 1 days (4 rotations)
empty log files are not rotated, old logs mailed to
admin@alonso-heul-doch.de
considering log /var/log/apache2/access.log
log needs rotating
considering log /var/log/apache2/error.log
log needs rotating
rotating log /var/log/apache2/access.log, log->rotateCount is 4
previous log /var/log/apache2/access.log.0 does not exist
renaming /var/log/apache2/access.log.3.gz to
/var/log/apache2/access.log.4.gz (rotatecount 4, logstart 0, i 3),
renaming /var/log/apache2/access.log.2.gz to
/var/log/apache2/access.log.3.gz (rotatecount 4, logstart 0, i 2),
renaming /var/log/apache2/access.log.1.gz to
/var/log/apache2/access.log.2.gz (rotatecount 4, logstart 0, i 1),
renaming /var/log/apache2/access.log.0.gz to
/var/log/apache2/access.log.1.gz (rotatecount 4, logstart 0, i 0),
renaming /var/log/apache2/access.log to /var/log/apache2/access.log.0
creating new log mode = 0640 uid = 0 gid = 4
error: failed to open /var/log/apache2/access.log.4.gz for mailing: No
such file or directory
rotating log /var/log/apache2/error.log, log->rotateCount is 4
previous log /var/log/apache2/error.log.0 does not exist
renaming /var/log/apache2/error.log.3.gz to
/var/log/apache2/error.log.4.gz (rotatecount 4, logstart 0, i 3),
renaming /var/log/apache2/error.log.2.gz to
/var/log/apache2/error.log.3.gz (rotatecount 4, logstart 0, i 2),
renaming /var/log/apache2/error.log.1.gz to
/var/log/apache2/error.log.2.gz (rotatecount 4, logstart 0, i 1),
renaming /var/log/apache2/error.log.0.gz to
/var/log/apache2/error.log.1.gz (rotatecount 4, logstart 0, i 0),
renaming /var/log/apache2/error.log to /var/log/apache2/error.log.0
creating new log mode = 0640 uid = 0 gid = 4
error: failed to open /var/log/apache2/error.log.4.gz for mailing: No
such file or directory
running shared postrotate script
running script with arg /var/log/apache2/*.log : "
if [ -f /var/run/apache2.pid ]; then
/etc/init.d/apache2 restart > /dev/null
fi
"
ABER:
l /var/log/apache2/
insgesamt 22M
drwxr-xr-x 2 root root 4,0K 2007-08-07 13:04 .
drwxr-xr-x 12 root root 4,0K 2007-09-07 18:03 ..
-rw-r----- 1 root adm 21M 2007-09-10 15:46 access.log
-rw-r----- 1 root adm 964K 2007-09-10 05:01 error.log
Wie sie sehen, sehen sie nichts! Ich habe absolut keine ahnung mehr,
woran das liegen könnte. Die Fehlermeldungen sind mir eigentlich klar;
ein error.log.4.gz kann es noch nicht geben, da ja überhaupt noch nicht
rotiert wurde. Aber wieso sagt er mir, dass er rotiert hat wenn er es
doch gar nicht getan hat?
Komischer Weise funzt das auf ner anderen Maschine einwandfrei!
Hier noch die logrotate.conf:
cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
daily
# keep 4 weeks worth of backlogs
rotate 4
# create new (empty) log files after rotating old ones
create
# uncomment this if you want your log files compressed
compress
mail admin@alonso-heul-doch.de
# packages drop log rotation information into this directory
include /etc/logrotate.d
Danke für jeden Hinweis!
Andy
Reply to: