rotating squid logs using logadm

From: Brett Lymn (blymn@baesystems.com.au)
Date: Thu Sep 16 2004 - 08:34:19 EDT


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@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers


This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:29:27 EDT