Koozali.org: home of the SME Server

Pruning SARG files in /var/www/html/squid

Mark Drone

Pruning SARG files in /var/www/html/squid
« on: December 28, 2002, 01:52:18 AM »
On a couple of machines that SARG (Squid Access Report Generator) is installed on, the HTML files that it generates in the daily, weekly, and monthly subdirectories of /var/www/html/squid have grown to such an extent that they need pruning.  These files grew so numerous that it crippled one machine when the filesystem disk space usage on /dev/hda6 topped out at 100%.  

To do a quick fix, I wrote a very simple shell script that prunes files older than 90 days, after which it rebuilds the index pages.  
=============================================
#!/bin/sh

find /var/www/html/squid  -mtime +90 -exec rm -Rf {} \;

/usr/sbin/sarg.daily
/usr/sbin/sarg.weekly
/usr/sbin/sarg.monthly
=============================================
I suspect that SARG has some built-in feature that limits the number of HTML records it generates, or automagically prunes these files to some pre-defined value.  Does anyone know if SARG has anything like this?

TIA,
-MD

krusty

Re: Pruning SARG files in /var/www/html/squid
« Reply #1 on: December 28, 2002, 12:10:11 PM »
Where do you put this file? Do you have to place it in another file?

Mark Drone

Re: Pruning SARG files in /var/www/html/squid
« Reply #2 on: December 28, 2002, 04:27:41 PM »
I saved the script as "prune-SARG.sh" &chmod 700) and just run it from the command line. It needs some work before moving it into /etc/cron.monthly...such as error handling.


krusty wrote:
>
> Where do you put this file? Do you have to place it in
> another file?