[SUMMARY] rotating squid logs using logadm

Brett Lymn blymn at baesystems.com.au
Thu Sep 16 22:25:31 EDT 2004


Last night I posted the message quoted below.  I received the flood of
out of office messages along with a very helpful response from Bill R.
Williams.  Though Bill did not directly give me the answer he pointed out
how the linux logrotate worked with squid, from that I managed to brew
up the right logadm syntax:

squid -C 60 -a '/opt/local/squid/sbin/squid -k rotate; sleep 2; rm -f /logs/squi
d/*.log.0' -c -p 1d -t '$file.%Y%m%d' -z 0 '/logs/squid/{access,cache,store}.log

The logs get copied and truncated.  After that I tell squid to rotate the logs
and remove the redundant copy of the logs.  There is a small window of
log info we don't capture but I am not too concerned about that.

Thanks be to Bill.

Liberal application of the clue-stick goes to:

tclever at pironet-ndh.com
Wallace.MA at rbos.com   
sherman.butler at gettyimages.com
Andy.Scutt at jobpartners.com
John.Hilger at veritas.com
KJenkinson at ironmountain.co.uk
Dietmar.Swoboda at HVBInfo.com

Come on people, even outlook's lame mail filtering capabilities could have
saved this useless notification.

On Thu, Sep 16, 2004 at 10:04:19PM +0930, Brett Lymn wrote:
> Folks,
> 
> I brave the veritable deluge of out of office notifications (waves 
> cluestick on high at said persons) to seek help with logadm.
> 
> I have a squid proxy server and in the past I have run a script to rotate
> my squid logs around.  I wanted to use logadm in solaris 9 to do this since
> it looks to be a neater solution than having lots of little log rotate
> scripts.  The problem is that I cannot get the syntax right, when you
> ask squid to rotate it's logs it produces a file of the form access.log.0
> which is the file I want to rename, and compress.  The problem is that
> if I tell logadm to look for access.log.0 it says the file does not exist
> and bails out, the -N option suppresses the error message but no logs are
> rotated.  I am half tempted to a) log a bug report with Sun saying the
> presence of the log file should be checked _after_ the pre-rotate script
> is run or b) resort to scripting my own log rotation again.  Before I do
> either of these I thought I would throw myself upon the collective wisdom
> (and auto-responders...grrr) of this list.  This is the logadm entry
> for my squid rotation:
> 
> squid -C 60 -b '/opt/local/squid/sbin/squid -k rotate; sleep 240' -p 1d -t $file.%Y%m%d -z 0 '/logs/squid/{access,cache,store}.log.0'
> 
> I don't really want to shutdown squid every night just to rotate the logs.
> 
> Suggestions most welcome.
> 

-- 
Brett Lymn
_______________________________________________
sunmanagers mailing list
sunmanagers at sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



More information about the summaries mailing list