Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am running Squid 3 on Ubuntu 10.04, with SARG for reports. It's mostly working quite well, but I'm running into problems with the server becoming totally full with the SARG reports.

I created this script, that tries to get rid of anything older than 45 days in the reports folder, but I think it caused some problems, because SARG hasn't run properly since then.

find /var/www/squid-reports/* -type f -mtime +45 -exec rm -f {} \;
find /var/www/squid-reports/* -type d -mtime +45 -exec rmdir {} \;

What would be the recommended way to take care of this? Thank you!

share|improve this question
up vote 4 down vote accepted

There is a configuration option lastlog for /etc/squid/sarg.conf that allows you to specify how many days worth of logs to keep e.g.

lastlog 45

to keep 45 days worth of logs. The default is 0 which means keep all logs.

# TAG: lastlog n
#      How many reports files must be keept in reports directory.
#      The oldest report file will be automatically removed.
#      0 - no limit.
lastlog 0
share|improve this answer
I feel so stupid right now... :) Thanks!!!! – UrkoM Oct 4 '11 at 8:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.