4

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!

UrkoM
  • 383
  • 4
  • 17

1 Answers1

6

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
user9517
  • 115,471
  • 20
  • 215
  • 297
  • Perhaps the default install location has changed as sarg.conf is now located at /etc/sarg/sarg.conf (at least for me anyway) – David Jan 03 '17 at 11:41