Search squid archive

RE: Squid log management questions

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

 



Adjust paths as necessary...

access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log

/etc/cron.hourly/rotatelogs.sh
	#!/bin/bash
	# this script rotates squid logs hourly and renames with a
timestamp
	/usr/local/squid/sbin/squid -k rotate
	sleep 10
	mv /var/log/squid/access.log.0
/var/log/squid/access.${NOW:=$(date +"%m-%d-%Y_%H")}.log
	mv /var/log/squid/cache.log.0 /var/log/squid/cache.${NOW:=$(date
+"%m-%d-%Y_%H")}.log
	chmod +r /var/log/squid/*

/etc/cron.daily/archivelogs.sh
	#!/bin/bash
	# this script archives and compresses logs daily to
/var/log/squid/store
	cd /var/log/squid/
	tar -C /var/log/squid -zcf
/var/log/squid/store/$(hostname)_$(date -d yesterday +"%m-%d-%Y").tgz
*.$(date -d yesterday +"%m-%d-%Y")_*.log
	chmod +r /var/log/squid/store/*
	rm /var/log/squid/*.$(date -d yesterday +"%m-%d-%Y")_*.log -f



-----Original Message-----
From: a bv [mailto:vbavbalist@xxxxxxxxx] 
Sent: Tuesday, March 10, 2009 1:31 AM
To: squid-users@xxxxxxxxxxxxxxx
Subject:  Squid log management questions

Hi list,

I need a bash script (which ill take it to the cron) for
archiving/storing the squid log files. At the enviroment there are
multiple squid running servers at which the log
files are at a different path then defaults. For now ill need this
script to  compress , rename the access.log files to logdate.tar.gz
and copy it with ftp to an other server. I need to archive all the
files. Cause there are not so much disk space at the servers ill have
an external usb disk (hope to have soon) and go on archiving the all
files to there.  (make this usb disk physically connected to a server
then
And also i have some questions:

How do you store, manage your squid files ? Which log files of squid
do you keep? How long do you keep this files? what is the source of
these choices, you,company or compliance issues?

Regards


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

  Powered by Linux