LINUX.ORG.RU

logrotate don't work


0

0

Доброго время суток!

Помогите разобраться почему на работает logrotate

conf:

root@dev:/# cat /etc/logrotate.d/exim4-base
/var/log/exim4/mainlog /var/log/exim4/rejectlog {
#size=5M
daily
missingok
rotate 10
compress
delaycompress
notifempty
create 640 Debian-exim adm
}

log:

rotating pattern: /var/log/exim4/mainlog /var/log/exim4/rejectlog after 1 days (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/exim4/mainlog
log needs rotating
considering log /var/log/exim4/rejectlog
log needs rotating
rotating log /var/log/exim4/mainlog, log->rotateCount is 10
previous log /var/log/exim4/mainlog.1 does not exist
renaming /var/log/exim4/mainlog.10.gz to /var/log/exim4/mainlog.11.gz (rotatecount 10, logstart 1, i 10),
renaming /var/log/exim4/mainlog.9.gz to /var/log/exim4/mainlog.10.gz (rotatecount 10, logstart 1, i 9),
renaming /var/log/exim4/mainlog.8.gz to /var/log/exim4/mainlog.9.gz (rotatecount 10, logstart 1, i 8),
renaming /var/log/exim4/mainlog.7.gz to /var/log/exim4/mainlog.8.gz (rotatecount 10, logstart 1, i 7),
renaming /var/log/exim4/mainlog.6.gz to /var/log/exim4/mainlog.7.gz (rotatecount 10, logstart 1, i 6),
renaming /var/log/exim4/mainlog.5.gz to /var/log/exim4/mainlog.6.gz (rotatecount 10, logstart 1, i 5),
renaming /var/log/exim4/mainlog.4.gz to /var/log/exim4/mainlog.5.gz (rotatecount 10, logstart 1, i 4),
renaming /var/log/exim4/mainlog.3.gz to /var/log/exim4/mainlog.4.gz (rotatecount 10, logstart 1, i 3),
renaming /var/log/exim4/mainlog.2.gz to /var/log/exim4/mainlog.3.gz (rotatecount 10, logstart 1, i 2),
renaming /var/log/exim4/mainlog.1.gz to /var/log/exim4/mainlog.2.gz (rotatecount 10, logstart 1, i 1),
renaming /var/log/exim4/mainlog.0.gz to /var/log/exim4/mainlog.1.gz (rotatecount 10, logstart 1, i 0),
renaming /var/log/exim4/mainlog to /var/log/exim4/mainlog.1
creating new log mode = 0640 uid = 105 gid = 4
removing old log /var/log/exim4/mainlog.11.gz
rotating log /var/log/exim4/rejectlog, log->rotateCount is 10
previous log /var/log/exim4/rejectlog.1 does not exist
renaming /var/log/exim4/rejectlog.10.gz to /var/log/exim4/rejectlog.11.gz (rotatecount 10, logstart 1, i 10),
renaming /var/log/exim4/rejectlog.9.gz to /var/log/exim4/rejectlog.10.gz (rotatecount 10, logstart 1, i 9),
renaming /var/log/exim4/rejectlog.8.gz to /var/log/exim4/rejectlog.9.gz (rotatecount 10, logstart 1, i 8),
renaming /var/log/exim4/rejectlog.7.gz to /var/log/exim4/rejectlog.8.gz (rotatecount 10, logstart 1, i 7),
renaming /var/log/exim4/rejectlog.6.gz to /var/log/exim4/rejectlog.7.gz (rotatecount 10, logstart 1, i 6),
renaming /var/log/exim4/rejectlog.5.gz to /var/log/exim4/rejectlog.6.gz (rotatecount 10, logstart 1, i 5),
renaming /var/log/exim4/rejectlog.4.gz to /var/log/exim4/rejectlog.5.gz (rotatecount 10, logstart 1, i 4),
renaming /var/log/exim4/rejectlog.3.gz to /var/log/exim4/rejectlog.4.gz (rotatecount 10, logstart 1, i 3),
renaming /var/log/exim4/rejectlog.2.gz to /var/log/exim4/rejectlog.3.gz (rotatecount 10, logstart 1, i 2),
renaming /var/log/exim4/rejectlog.1.gz to /var/log/exim4/rejectlog.2.gz (rotatecount 10, logstart 1, i 1),
renaming /var/log/exim4/rejectlog.0.gz to /var/log/exim4/rejectlog.1.gz (rotatecount 10, logstart 1, i 0),
renaming /var/log/exim4/rejectlog to /var/log/exim4/rejectlog.1
creating new log mode = 0640 uid = 105 gid = 4
removing old log /var/log/exim4/rejectlog.11.gz


Но в конечном итоге не создаются файлы :

var/log/exim4/mainlog.1
var/log/exim4/rejectlog.1

А файлы подходят под условие "notifempty"? Можно еще запустить logrotate под strace и посмотреть что от делает.

mky ★★★★★
()
9 октября 2008 г.
Ответ на: комментарий от mky

Гы, тож проблема была в logrotate. Вылечил, закомментировав notifempty

Incred
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.