Re: Squid restarting several times after rotating logs

From: Colin Campbell <>
Date: Thu, 7 Oct 1999 17:06:24 +1000 (EST)


Here's how I rotate my logs, every night at midnight.

prog=`basename $0`

LOGS="access.log cache.log store.log"


# timestamp the logs
now=`date "+%Y%m%d.%H%M%S"`
if [ -z "$now" ]; then
        echo "$prog: cannot get date - exiting"
        exit 1

for log in $LOGS; do
        if [ -f $log ]; then
                mv $log $log.$now

# get squid to rotate the logs
/squid/bin/squid -k rotate

# if everything worked, move the logfiles to the archive dir
sleep 30 # let squid catch up
for log in $LOGS; do
        if [ -f $log ]; then # the proper log exists
                mv $log.$now $ARCHDIR

# make 'em smaller
for log in $LOGS; do
        if [ -f $log.$now ]; then # the proper log exists
                gzip $log.$now

exit 0
I also set the rotate variable (logfile_rotate 0) in squid.conf to zero
"0" so I can name the files as I want.


On Thu, 7 Oct 1999, Raymond Brighenti wrote:

> Hi All,
> Sorry for the large email but I though including the log file might give
> people a better view of what's happening.
> Basically each day at midnight I have a cron job run
> (/usr/local/squid/bin/squid -k rotate) to rotate the Squid log files, the
> problem is that each time it does Squid restarts every 10 seconds or so 4
> or 5 times, it does this every day(night :).
> Is this because of the way I rotate the files?
> If so is there a better way to rotate the files?
Received on Thu Oct 07 1999 - 01:22:39 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:48:45 MST