Hi all,

I am trying to configure logrotate, but I am having a lot of problems.

Can you help me?

Here you can find a brief desription of directories and files at my
machine:

/opt/squid/var/logs/ # ll
total 150903
-rw-r--r-- 1 user usergroup 66243001 Jun 9 17:04 access.log
-rw-r--r-- 1 user usergroup 303 Jun 8 15:36 cache.log
drwxr-xr-x 2 user usergroup 4528 Jun 9 15:01 rotated
-rw-r--r-- 1 user usergroup 5 Jan 21 17:51 squid.pid
-rw-r--r-- 1 user usergroup 83165969 Jun 9 17:04 store.log


/opt/squid/var/logs> crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.22736 installed on Fri Jun 9 17:02:20 2006)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp
$)
03 17 * * * /usr/sbin/logrotate /etc/logrotate.d/squid


/etc/ # cat logrotate.conf
# see "man logrotate" for details
# rotate log files daily
daily

# keep 30 days worth of backlogs
rotate 30

# create new (empty) log files after rotating old ones
create

# uncomment this if you want your log files compressed
compress

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own lastlog or wtmp -- we'll rotate them here
#/var/log/wtmp {
# monthly
# create 0664 root utmp
# rotate 1
#}

# system-specific logs may be also be configured here.


/etc/logrotate.d/ # cat squid
#testing logrotate for gxo03ipa
compress

/opt/squid/var/logs/access.log {
rotate 30
dateext
missingok
create 640 user usergroup
}

/opt/squid/var/logs/store.log {
rotate 20
dateext
missingok
create 640 user usergroup
postrotate
/etc/rc.d/squid reload
endscript
}

/opt/squid/etc/ #cat squid.conf
....
# TAG: logfile_rotate
# Specifies the number of logfile rotations to make when you
# type 'squid -k rotate'. The default is 10, which will rotate
# with extensions 0 through 9. Setting logfile_rotate to 0 will
# disable the rotation, but the logfiles are still closed and
# re-opened. This will enable you to rename the logfiles
# yourself just before sending the rotate signal.
#
# Note, the 'squid -k rotate' command normally sends a USR1
# signal to the running squid process. In certain situations
# (e.g. on Linux with Async I/O), USR1 is used for other
# purposes, so -k rotate uses another signal. It is best to get
# in the habit of using 'squid -k rotate' instead of 'kill -USR1
# '.
#
#Default:
logfile_rotate 0
....


/etc/ # ps -ef | grep squid
user 1531 1 0 Jan21 ? 00:00:00 /opt/squid/sbin/squid -D
user 1533 1531 0 Jan21 ? 21:03:37 (squid) -D
root 22933 22757 0 17:11 pts/0 00:00:00 grep squid


Thanks.