darold / squidanalyzer

Squid Analyzer parses Squid proxy access log and reports general statistics about hits, bytes, users, networks, top URLs, and top second level domains. Statistic reports are oriented toward user and bandwidth control.
http://squidanalyzer.darold.net/
126 stars 36 forks source link

Purging old stats #154

Closed lravelo closed 7 years ago

lravelo commented 7 years ago

I'm already on v6.5. Never tried to purge old stats before but I need to regain some disk space. I did read about this issue here but wanted to know if there was a way I could test prior to changing the code (I never upgraded to v6.5 that's the version I originally installed).

Right now on logrotate I run the following: /usr/bin/squid-analyzer -d /opt/data/logs/squid3/access.log.1

Is this where I would need to modify in order to tell squidanalyzer to purge anything older than, say, 6 months by doing something like this?: /usr/bin/squid-analyzer -d -p 6 /opt/data/logs/squid3/access.log.1

darold commented 7 years ago

Yes, if you want to just keep the last 6 month use --preserve 6 or -p 6, so use the following command in your logrotate:

/usr/bin/squid-analyzer -p 6 /opt/data/logs/squid3/access.log.1

It will do the same work as before but will remove all statistics older than 6 month.

Regards

lravelo commented 7 years ago

good morning. I've tried this and, while I see the following message:

Obsolete statistics before 2016-08

it still doesn't purge the records.

darold commented 7 years ago

SquidAnalyzer use /bin/rm -rf DIR to remove the obsolete directories, perhaps this is the wrong path of the rm command or your system doesn't have this command.

lravelo commented 7 years ago

I have verified that /bin/rm exists in all servers running this application.

darold commented 7 years ago

Version 6.6 might solve this issue.