Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

#!/bin/bash
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
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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.