diff options
author | Alexander Wilke <nachtfalkeaw@web.de> | 2012-10-27 16:43:23 +0300 |
---|---|---|
committer | Alexander Wilke <nachtfalkeaw@web.de> | 2012-10-27 16:43:23 +0300 |
commit | 5f2e6b204079525ac3f4330fa4afeb03303f9af0 (patch) | |
tree | 22f834f7c74ad3e8261ec272412fd61251c62656 /config/squidGuard/squidguard_configurator.inc | |
parent | a03f9636a55c8154e33f8ab7a987dcd1800dfb1f (diff) | |
download | pfsense-packages-5f2e6b204079525ac3f4330fa4afeb03303f9af0.tar.gz pfsense-packages-5f2e6b204079525ac3f4330fa4afeb03303f9af0.tar.bz2 pfsense-packages-5f2e6b204079525ac3f4330fa4afeb03303f9af0.zip |
SquidGuard: Rotate GUI-Logfile
The SQUIDGUARD_GUILOG_MAXCOUNT limit to 500 lines does not seem to work. The /var/squidGuard/log/squidGuard.log is increasing over this limit.
This patch rotates this file daily when logrotation is enabled and cuts this file after the last 1000 lines - the same as with /var/squidGuard/log/block.log
Diffstat (limited to 'config/squidGuard/squidguard_configurator.inc')
-rw-r--r-- | config/squidGuard/squidguard_configurator.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/config/squidGuard/squidguard_configurator.inc b/config/squidGuard/squidguard_configurator.inc index 2aba1e8d..5e822bfa 100644 --- a/config/squidGuard/squidguard_configurator.inc +++ b/config/squidGuard/squidguard_configurator.inc @@ -123,6 +123,7 @@ define('TMP_DIR', '/var/tmp'); define('SQUIDGUARD_CONFIGFILE', '/squidGuard.conf'); define('SQUIDGUARD_CONFLOGFILE', '/sg_configurator.log'); define('SQUIDGUARD_LOGFILE', 'block.log'); +define('SQUIDGUARD_GUILOGFILE', 'squidGuard.log'); define('SQUIDGUARD_CONFBASE', SQUID_LOCALBASE . '/etc/squid'); define('SQUIDGUARD_WORKDIR', SQUIDGUARD_LOCALBASE . '/etc/squidGuard'); define('SQUIDGUARD_BINPATH', SQUIDGUARD_LOCALBASE . '/bin'); @@ -1878,14 +1879,20 @@ function sg_script_logrotate() global $squidguard_config; $sglogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_LOGFILE; + $sgguilogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_GUILOGFILE; $res = <<<EOD #!/bin/sh # # This file generated automaticly with SquidGuard configurator +# Rotates the block logile tail -{$lines} {$sglogname} > {$sglogname}.0 tail -{$lines} {$sglogname}.0 > {$sglogname} rm -f {$sglogname}.0 +# Rotates the squidguard GUI logile +tail -{$lines} {$sgguilogname} > {$sgguilogname}.0 +tail -{$lines} {$sgguilogname}.0 > {$sgguilogname} +rm -f {$sgguilogname}.0 EOD; return $res; } |