SquidGuard Log Rotate - more than one day - How to !?



  • Hi,

    I tried to increase the time of the one day log rotate for "blocked" URLs.

    I changed this in squidguard_configuratror.inc
    It should start one time a week at 4:04am

    # ------------------------------------------------------------------------------
    # squidguard_setup_cron
    # ------------------------------------------------------------------------------
    function squidguard_cron_install()
    {
        global $squidguard_config;
    
        $on_off = $squidguard_config[F_LOGROTATION] == 'on';
    
        $opt = "";
        if ($on_off) {
            $opt    = array("4", "4", "*", "*", "1", "root", "/usr/bin/nice -n20 " . SQUIDGUARD_SCR_LOGROTATE);
        }
        squidguard_setup_cron("squidGuard_logrotate", $opt, $on_off);
    }
    
    

    And I changed this part in same .inc file:
    So there are saved 10.000 lines instead of 1.000 as before. But I do not get more log entries in SquidGuard -> Log -> Blocked

    # -----------------------------------------------------------------------------
    # sg_script_logrotate
    # truncate SG logfile to $lines
    # -----------------------------------------------------------------------------
    function sg_script_logrotate()
    {
        $lines = 10000; # SG logfile truncate lines count
    
        global $squidguard_config;
        $sglogname = $squidguard_config[F_LOGDIR] . "/" . SQUIDGUARD_LOGFILE;
        $res =
    <<<eod<br>#!/bin/sh
    #
    # This file generated automaticly with SquidGuard configurator
    tail -{$lines} {$sglogname} > {$sglogname}.0
    tail -{$lines} {$sglogname}.0 > {$sglogname}
    rm -f {$sglogname}.0
    EOD;
        return $res;
    }</eod<br> 
    

    Thanks in advance!



  • Hmm…noone who could or would help me ?



  • If you change:/etc/crontab …...?

    0      0      *      *      *      root    /usr/bin/nice -n20 /usr/local/etc/rc.d/squidGuard_logrotate

    0      0      *      *        0,2,4,6  root    /usr/bin/nice -n20 /usr/local/etc/rc.d/squidGuard_logrotate

    0=su
    2=tu
    4=th
    6=sa



  • Hi,

    I thought I did this with this line:

          $opt    = array("4", "4", "*", "*", "1", "root", "/usr/bin/nice -n20 " . SQUIDGUARD_SCR_LOGROTATE);
    

    The cron tab changed to:

    4      4      *      *        1  root    /usr/bin/nice -n20 /usr/local/etc/rc.d/squidGuard_logrotate

    Which is - if I am right:
    Every monday at 04:04AM, isn't it ?


Log in to reply