Logrotate prestal rotovat - delsi

Martin Och martin na och.cz
Úterý Leden 18 09:12:35 CET 2005


Dobry den,

zjistitl jsem, ze cca 7. 1. 2005 mi prestal rotovat logrotate.
Nevidim k tomu jediny duvod, a v logach neni nic, co by rikalo proc.
/etc/logrotate.conf obsahuje:
daily
rotate 7
create
nocompress
include /etc/logrotate.d/apache
--

/etc/logrotate.d/apache obsahuje:
/var/log/httpd/*_log {
    sharedscripts
    rotate 7
    daily
    missingok
    notifempty
    nocompress
    prerotate
        /etc/init.d/httpd stop >/dev/null
    endscript
    postrotate
        /etc/init.d/httpd start >/dev/null
    endscript
}

Nemyslim si, ze neco zavadneho...
Ve /var/log/httpd je:
-rw-r-----    1 root     root           22 Jan 18 09:00 access_log
-rw-r--r--    1 root     root        11221 Jan 18 08:48 error_log

No a kdyz spustim:
#logrotate -dfv -s /var/lib/logrotate/state /etc/logrotate.conf 2>/log
Tak v /log je:
reading config file /etc/logrotate.conf
including /etc/logrotate.d/apache
reading config file /etc/logrotate.d/apache
reading config info for /var/log/httpd/*_log
reading config info for /var/log/wtmp
reading config info for /var/log/lastlog

Handling 3 logs

rotating pattern: /var/log/httpd/*_log  forced from command line (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
  log needs rotating
considering log /var/log/httpd/error_log
  log needs rotating
running shared prerotate script
running script with arg /var/log/httpd/*_log : "
        /etc/init.d/httpd stop >/dev/null
"
rotating log /var/log/httpd/access_log, log->rotateCount is 7
renaming /var/log/httpd/access_log.7 to /var/log/httpd/access_log.8 (rotatecount
7, logstart 1, i 7),
renaming /var/log/httpd/access_log.6 to /var/log/httpd/access_log.7 (rotatecount
7, logstart 1, i 6),
renaming /var/log/httpd/access_log.5 to /var/log/httpd/access_log.6 (rotatecount
7, logstart 1, i 5),
renaming /var/log/httpd/access_log.4 to /var/log/httpd/access_log.5 (rotatecount
7, logstart 1, i 4),
renaming /var/log/httpd/access_log.3 to /var/log/httpd/access_log.4 (rotatecount
7, logstart 1, i 3),
renaming /var/log/httpd/access_log.2 to /var/log/httpd/access_log.3 (rotatecount
7, logstart 1, i 2),
renaming /var/log/httpd/access_log.1 to /var/log/httpd/access_log.2 (rotatecount
7, logstart 1, i 1),
renaming /var/log/httpd/access_log.0 to /var/log/httpd/access_log.1 (rotatecount
7, logstart 1, i 0),
renaming /var/log/httpd/access_log to /var/log/httpd/access_log.1
creating new log mode = 0640 uid = 0 gid = 0
removing old log /var/log/httpd/access_log.8
rotating log /var/log/httpd/error_log, log->rotateCount is 7
renaming /var/log/httpd/error_log.7 to /var/log/httpd/error_log.8 (rotatecount
7, logstart 1, i 7),
renaming /var/log/httpd/error_log.6 to /var/log/httpd/error_log.7 (rotatecount
7, logstart 1, i 6),
renaming /var/log/httpd/error_log.5 to /var/log/httpd/error_log.6 (rotatecount
7, logstart 1, i 5),
renaming /var/log/httpd/error_log.4 to /var/log/httpd/error_log.5 (rotatecount
7, logstart 1, i 4),
renaming /var/log/httpd/error_log.3 to /var/log/httpd/error_log.4 (rotatecount
7, logstart 1, i 3),
renaming /var/log/httpd/error_log.2 to /var/log/httpd/error_log.3 (rotatecount
7, logstart 1, i 2),
renaming /var/log/httpd/error_log.1 to /var/log/httpd/error_log.2 (rotatecount
7, logstart 1, i 1),
renaming /var/log/httpd/error_log.0 to /var/log/httpd/error_log.1 (rotatecount
7, logstart 1, i 0),
renaming /var/log/httpd/error_log to /var/log/httpd/error_log.1
creating new log mode = 0644 uid = 0 gid = 0
removing old log /var/log/httpd/error_log.8
running shared postrotate script
running script with arg /var/log/httpd/*_log : "
        /etc/init.d/httpd start >/dev/null
"

Nic neodrotuje, obsah adresare /var/log/httpd se nezmeni,
a ve /var/lib/logrotate/status je pouze:
logrotate state -- version 2

Myslim, ze by tam mely byt filename a datumy posledni rotace.
Lec nejsou. A to bych videl jako prvni problem...

Netusi nekdo z Vas, co je spatne?

Dekuji

--
Martin Och



Další informace o konferenci Linux