Re: [squid-users] Problem with logrotate and compress

From: Chris Robertson <crobertson_at_gci.net>
Date: Tue, 08 Jul 2008 10:19:02 -0800

Sergio Belkin wrote:
> Hi I am using Centos 5.1 and I have a weird problem with squid logs
> rotation. I have the file squid as follow in /etc/logrotate.d:
>
> Recently I reduce size parameter.
>
> /var/log/squid/access.log {
> weekly
> missingok
> rotate 10
> compress
> create 0660 squid squid
> missingok
> size 200M
> postrotate
> /usr/sbin/squid -k rotate
> endscript
> }
> /var/log/squid/cache.log {
> weekly
> rotate 5
> copytruncate
> compress
> notifempty
> missingok
> }
>
> /var/log/squid/store.log {
> missingok
> weekly
> compress
> size 200M
> create 0660 root squid
> rotate 4
> # This script asks squid to rotate its logs on its own.
> # Restarting squid is a long process and it is not worth
> # doing it just to rotate logs
> postrotate
> /usr/sbin/squid -k rotate
> endscript
> }
>
> The strange thing is that I get the following files:
>
> -rw-r----- 1 squid squid 3.4M Jul 8 09:37 access.log
> -rw-r----- 1 squid squid 116K Jul 8 09:31 access.log.0
> -rw-rw---- 1 squid squid 0 Jul 8 09:31 access.log.1
> -rw-r----- 1 squid squid 20 Jul 8 09:31 access.log.1.gz
> -rw-r--r-- 1 squid squid 28M Jul 8 04:22 access.log.2.gz
> -rw-r----- 1 squid squid 39M Jul 8 09:31 access.log.3
> -rw-r--r-- 1 root root 29M Jul 7 15:58 access.log.3.gz
> -rw-r--r-- 1 squid squid 252M Jul 8 04:22 access.log.4
> -rw-r----- 1 squid squid 1.9K Jul 8 09:31 cache.log
> -rw-r----- 1 squid squid 0 Jul 8 09:31 cache.log.0
> -rw-r----- 1 squid squid 3.1K Jul 8 09:28 cache.log.1
> -rw-r----- 1 squid squid 367 Jul 8 09:31 cache.log.1.gz
> -rw-r----- 1 squid squid 367 Jul 8 04:22 cache.log.2.gz
> -rw-r--r-- 1 root root 12K Jun 11 15:40 squid.out
> -rw-r----- 1 squid squid 1.1M Jul 8 09:37 store.log
> -rw-rw---- 1 root squid 0 Jul 8 09:31 store.log.0
> -rw-r----- 1 squid squid 2.9M Jul 8 09:31 store.log.1.gz
> -rw-r----- 1 squid squid 42K Jul 8 09:31 store.log.2
> -rw-rw---- 1 root root 323M May 26 04:21 store.log.2.gz
> -rw-rw---- 1 root root 329M May 16 04:25 store.log.3.gz
> -rw-rw---- 1 root root 357M May 8 04:23 store.log.4.gz
>
>
> I don't understand why compress old log files but doesn't delete old
> non-compressed files uncompressed. Any ideas? (I've also modified
> create parameter for squid be owner of access logs and run by hand
> logrotate /etc/logrotate.d/squid to see if it repeats the case)
>
> Thanks in advance
>

Check your squid.conf file for the logfile_rotate directive. With your
setup it should be set as "logfile_rotate 0".

Chris
Received on Tue Jul 08 2008 - 18:19:24 MDT

This archive was generated by hypermail 2.2.0 : Wed Jul 09 2008 - 12:00:03 MDT