Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

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

    Scheduled Pinned Locked Moved pfSense Packages
    4 Posts 2 Posters 3.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Nachtfalke
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • N
        Nachtfalke
        last edited by

        Hmm…noone who could or would help me ?

        1 Reply Last reply Reply Quote 0
        • L
          LEPM
          last edited by

          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

          Your new system is probably coming with some hyper trash like Windows 8

          1 Reply Last reply Reply Quote 0
          • N
            Nachtfalke
            last edited by

            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 ?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.