The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]




Версия для распечатки Пред. тема | След. тема
Новые ответы [ Отслеживать ]
Logrotate, !*! skytix, 26-Окт-17, 07:23  [смотреть все]
Хочу ротейтить access.log squid, каждый месяц.
Store и cache каждый день.

Не получается.

В /etc/cron.dailym - есть файл logrotate
#!/bin/sh

test -x /usr/sbin/logrotate || exit 0
/usr/sbin/logrotate /etc/logrotate.conf


/etc/crontab
00 0 * * * root run-parts /etc/cron.daily


/etc/logrotate.d/squid

/var/log/squid/access.log {
        monthly
        compress
        delaycompress
        rotate 3
        missingok
        nocreate
        sharedscripts
        prerotate
                test ! -x /usr/sbin/sarg-reports || /usr/sbin/sarg-reports monthly
        endscript
        postrotate
                test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
        endscript
}

/var/log/squid/cache.log {
        daily
        nocompress
        delaycompress
        rotate 1
        missingok
        nocreate
        sharedscripts
        postrotate
                test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
        endscript
}

/var/log/squid/store.log {
        daily
        rotate 1
        compress
        delaycompress
        missingok
        nocreate
        sharedscripts
        postrotate
                test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
        endscript
}

  • Logrotate, !*! ALex_hha, 16:17 , 26-Окт-17 (1)
    • Logrotate, !*! skytix, 17:54 , 26-Окт-17 (2)
      >> Не получается.
      > а конкретнее?

      status:
      "/var/log/squid/cache.log" 2017-10-26-0:0:0
      "/var/log/squid/access.log" 2017-10-26-0:0:0
      "/var/log/squid/store.log" 2017-10-26-0:0:0

      access.log должен ротейтиться раз в месяц.

      cache.log и store.log раз в день.

      Но они почему-т не ротейтятся.((
      drwxr-xr-x 14 root  root       4096 Oct 25 19:06 ..
      -rw-r-----  1 proxy proxy 132432509 Oct 26 18:50 access.log
      -rw-r-----  1 proxy proxy    697117 Oct 26 18:46 cache.log
      -rw-r-----  1 proxy proxy  94767687 Oct 26 18:50 store.log

      И еще момент никак не пойму:

      Логи squidGuard ротейтятся в 0:00 каждый день.
      Но в них инф-ция:
      2017-10-25 19:06:26
      2017-10-25 19:09:31
      .......
      Хотелось, что бы с 0:00 писалось.

      • Logrotate, !*! ALex_hha, 14:40 , 27-Окт-17 (3)



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру