rotating squid logs using logadm

From: Brett Lymn (blymn_at_baesystems.com.au)
Date: 09/16/04

  • Next message: Angelo McComis: "Help: Securing dtremote sessions"
    Date: Thu, 16 Sep 2004 22:04:19 +0930
    To: sunmanagers@sunmanagers.org
    
    

    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
    

  • Next message: Angelo McComis: "Help: Securing dtremote sessions"

    Relevant Pages

    • [SUMMARY] rotating squid logs using logadm
      ... Though Bill did not directly give me the answer he pointed out ... The logs get copied and truncated. ... After that I tell squid to rotate the logs ...
      (SunManagers)
    • RE: "Proxy" server needed - Web Access Monitor?
      ... Usually that stuff is placed into a text file and then squid ... or alternative programs parse the logs. ... I know that SCO Unix server has ...
      (RedHat)
    • Re: "Proxy" server needed - Web Access Monitor?
      ... > Usually that stuff is placed into a text file and then squid ... > or alternative programs parse the logs. ... The user could care less about caching - they ... > can be a memory hog. ...
      (RedHat)
    • Re: "Proxy" server needed - Web Access Monitor?
      ... >>Usually that stuff is placed into a text file and then squid ... >>or alternative programs parse the logs. ... >>just want to monitor what URL's their staff is visiting. ... >>can be a memory hog. ...
      (RedHat)
    • Re: When is the TZ environment var set?
      ... it is apparently starting before the system timezone environment ... because it logs everything as GMT. ... any chance you're running it out of a chroot environment that doesn't ... We use logadm to keep the log files ...
      (comp.unix.solaris)