meine access_logs sollen per logrotate versioniert werden. Ich möchte aber keine gezippten Dateien sondern einfach eine Versionsnummer hinten dran.
Jetzt hatte ich mir so gedacht, dass es mit folgender Konfiguration gehen müsste:
/etc/logrotate.d/apache2:
Code: Select all
/var/log/apache2/access_log {
rotate 4
notifempty
missingok
create 644 root root
postrotate
/etc/init.d/apache2 reload
endscript
}
Code: Select all
rotate 4
create
include /etc/logrotate.d
/usr/sbin/logrotate -dfv /etc/logrotate.conf
aufrufe, scheint logrotate auch was zu machen:
Code: Select all
rotating pattern: /var/log/apache2/access_log forced from command line (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apache2/access_log
log needs rotating
rotating log /var/log/apache2/access_log, log->rotateCount is 4
renaming /var/log/apache2/access_log.4 to /var/log/apache2/access_log.5 (rotatecount 4, logstart 1, i 4),
renaming /var/log/apache2/access_log.3 to /var/log/apache2/access_log.4 (rotatecount 4, logstart 1, i 3),
renaming /var/log/apache2/access_log.2 to /var/log/apache2/access_log.3 (rotatecount 4, logstart 1, i 2),
renaming /var/log/apache2/access_log.1 to /var/log/apache2/access_log.2 (rotatecount 4, logstart 1, i 1),
renaming /var/log/apache2/access_log.0 to /var/log/apache2/access_log.1 (rotatecount 4, logstart 1, i 0),
renaming /var/log/apache2/access_log to /var/log/apache2/access_log.1
creating new log mode = 0644 uid = 0 gid = 0
running postrotate script
running script with arg /var/log/apache2/access_log: "
/etc/init.d/apache2 reload
"
removing old log /var/log/apache2/access_log.5
Hat jemand eine Idee, was ich falsch mache?
Gruß,
mikum
