syslog-ng + logrotate (FreeBSD 11.0)

Проблемы с установкой, настройкой и работой системных и сетевых программ.

Модераторы: GRooVE, alexco

Правила форума
Убедительная просьба юзать теги [code] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
boffin
рядовой
Сообщения: 14
Зарегистрирован: 2011-05-26 13:12:37

syslog-ng + logrotate (FreeBSD 11.0)

Непрочитанное сообщение boffin » 2017-02-03 11:35:38

Привет.
Помогите разобраться.
настроен сабж, но логи не ротируются хотя в дебаге пишется что все отработало.
Конфиг:

Код: Выделить всё

/usr/home/servers_logs/cabinet/server-extMin/*/*/*.log
{
    daily
    compress
    nocreate
    nocopy
    rotate 31
    notifempty
    sharedscripts
    postrotate
        /usr/sbin/service syslog-ng restart
    endscript
}


вывод /usr/local/sbin/logrotate -d -f /usr/local/etc/logrotate.conf

Код: Выделить всё

reading config file /usr/local/etc/logrotate.conf
including /usr/local/etc/logrotate.d
Allocating hash table for state file, size 64 entries

Handling 1 logs

rotating pattern: /usr/home/servers_logs/cabinet/server-extMin/*/*/*.log
 forced from command line (31 rotations)
empty log files are not rotated, old logs are removed
considering log /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log
  log needs rotating
rotating log /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log, log->rotateCount is 31
dateext suffix '-20170203'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.31.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.32.gz (rotatecount 31, logstart 1, i 31),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.30.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.31.gz (rotatecount 31, logstart 1, i 30),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.29.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.30.gz (rotatecount 31, logstart 1, i 29),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.28.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.29.gz (rotatecount 31, logstart 1, i 28),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.27.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.28.gz (rotatecount 31, logstart 1, i 27),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.26.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.27.gz (rotatecount 31, logstart 1, i 26),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.25.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.26.gz (rotatecount 31, logstart 1, i 25),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.24.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.25.gz (rotatecount 31, logstart 1, i 24),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.23.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.24.gz (rotatecount 31, logstart 1, i 23),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.22.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.23.gz (rotatecount 31, logstart 1, i 22),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.21.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.22.gz (rotatecount 31, logstart 1, i 21),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.20.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.21.gz (rotatecount 31, logstart 1, i 20),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.19.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.20.gz (rotatecount 31, logstart 1, i 19),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.18.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.19.gz (rotatecount 31, logstart 1, i 18),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.17.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.18.gz (rotatecount 31, logstart 1, i 17),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.16.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.17.gz (rotatecount 31, logstart 1, i 16),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.15.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.16.gz (rotatecount 31, logstart 1, i 15),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.14.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.15.gz (rotatecount 31, logstart 1, i 14),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.13.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.14.gz (rotatecount 31, logstart 1, i 13),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.12.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.13.gz (rotatecount 31, logstart 1, i 12),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.11.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.12.gz (rotatecount 31, logstart 1, i 11),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.10.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.11.gz (rotatecount 31, logstart 1, i 10),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.9.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.10.gz (rotatecount 31, logstart 1, i 9),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.8.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.9.gz (rotatecount 31, logstart 1, i 8),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.7.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.8.gz (rotatecount 31, logstart 1, i 7),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.6.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.7.gz (rotatecount 31, logstart 1, i 6),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.5.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.6.gz (rotatecount 31, logstart 1, i 5),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.4.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.5.gz (rotatecount 31, logstart 1, i 4),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.3.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.4.gz (rotatecount 31, logstart 1, i 3),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.2.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.3.gz (rotatecount 31, logstart 1, i 2),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.1.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.2.gz (rotatecount 31, logstart 1, i 1),
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.0.gz to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.1.gz (rotatecount 31, logstart 1, i 0),
log /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.32.gz doesn't exist -- won't try to dispose of it
renaming /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log to /usr/home/servers_logs/cabinet/server-extMin/2017/02/server-extMin.log.1
running postrotate script
running script with arg /usr/home/servers_logs/cabinet/server-extMin/*/*/*.log
: "
        /usr/sbin/service syslog-ng restart
"
compressing log with: /usr/bin/gzip


Итог:

Код: Выделить всё

# ls -l /usr/home/servers_logs/cabinet/server-extMin/2017/02/
total 5325
-rw-r-----  1 root  wheel  37850863 Feb  3 10:31 server-extMin.log

boffin
рядовой
Сообщения: 14
Зарегистрирован: 2011-05-26 13:12:37

syslog-ng + logrotate (FreeBSD 11.0)

Непрочитанное сообщение boffin » 2017-02-03 16:26:47

отбой. дебаг надо было вырубить.


Вернуться в «Софт»

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и 18 гостей