我在 Ubuntu 10.04 上运行 Squid 3,使用 SARG 进行报告。它大多运行良好,但我遇到了服务器因 SARG 报告而变得完全充满的问题。
我创建了这个脚本,它试图删除报告文件夹中超过 45 天的任何内容,但我认为它引起了一些问题,因为 SARG 从那时起就无法正常运行。
#!/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 {} \;
Run Code Online (Sandbox Code Playgroud)
处理这个问题的推荐方法是什么?谢谢!
有配置选项lastlog
的/etc/squid/sarg.conf
,允许你指定多少天的日志,以保持如
lastlog 45
Run Code Online (Sandbox Code Playgroud)
保留 45 天的日志。默认值为 0,表示保留所有日志。
# 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
Run Code Online (Sandbox Code Playgroud)