Re: [squid-users] access.log

From: Henrik Nordstrom <henrik@dont-contact.us>
Date: Sun, 24 Jun 2007 12:04:05 +0200

lör 2007-06-23 klockan 01:33 +0300 skrev Firas A. Mubarak:
> Thats also good, but how to do this ?

Set logfile_rotate to 0 in squid.conf to disable the automatic rotation,
then write a small script doing the log rotation as you want to have it
and then issue "squid -k rotate" to have Squid reopen the logs..

Note: I would recommend using the ISO standard time format...
YYYY-MM-DD-hh:mm:ss, much much easier to sort the logs that way..

#!/bin/sh
timestamp=`date +%Y-%m-%d-%H:%M:%S`
mv /var/log/squid/access.log /var/log/squid/archive/$timestamp-access.log
mv /var/log/squid/cache.log /var/log/squid/archive/$timestamp-cache.log
#mv /var/log/squid/store.log /var/log/squid/archive/$timestamp-store.log
/usr/local/sbin/squid -k rotate

sleep 3

if rsync -e ssh -a /var/log/squid/archive/ user@archiveserver:/path/to/archive/; then
   rm -f /var/log/squid/archive/*-timestamp
fi

Regards
Henrik

Received on Sun Jun 24 2007 - 04:04:10 MDT

This archive was generated by hypermail pre-2.1.9 : Sun Jul 01 2007 - 12:00:04 MDT