Search squid archive

Re: access.log

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Attachment: signature.asc
Description: Detta =?ISO-8859-1?Q?=E4r?= en digitalt signerad meddelandedel


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux