Re: [squid-users] access.log

From: Andreas Pettersson <andpet@dont-contact.us>
Date: Wed, 20 Jun 2007 21:23:38 +0200

Firas A. Mubarak wrote:
> this is a very good idea i likd it thank you very much, but once it
> rotate it just overwrite the previous log file.
> i want to keep all the access.log files stored for 6 momths .
> any ideas ?

I run this script every night, to gzip yesterdays access.log into an
archive dir, and put the date in the filename.
Of course you have to make sure there is disk space available, and some
sort of cleanup after 6 months.

#!/bin/sh

/usr/local/sbin/squid -k rotate
sleep 15
gzip -c -9 /usr/local/squid/logs/access.log.0 >
/usr/local/squid/logs/archive/access.log.`date -v -1d +%F`.gz

-- 
Andreas
Received on Wed Jun 20 2007 - 13:23:44 MDT

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