Re: suggested feature..

From: Michael Buchau <michael.buchau@dont-contact.us>
Date: Thu, 24 Feb 2000 23:25:40 +0100

Martin Brooks wrote:
>
> Just a thought for a future version of Squid. On the log rotation
> front, how about a facility to time/date stamp and compress the log
> file?

No need to hack squid for that one. Assuming that you have set
"logfile_rotate 0" in squid.conf, this little script should do the
trick:

#! /bin/sh
LOGDIR=/var/squid/logs
LOGFILES="access.log cache.log"
datestr=`date '+%Y%m%d'`

for f in $LOGFILES
do
    mv $LOGDIR/$f $LOGDIR/$f-$datestr
done
squid -k rotate
for f in $LOGFILES
do
    gzip $LOGDIR/$f-$datestr
done

-- 
-----------------------------------------------------------------------
Michael Buchau  <Michael.Buchau@Erlangen.Netsurf.DE>  Erlangen, Germany
-----------------------------------------------------------------------
Received on Thu Feb 24 2000 - 15:38:24 MST

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