Squid3 Log Rotate Problem

  • Hi everyone, I just have encountered this problem after upgrading squid.

    My squid logs were gone the next day everyday. I have discovered this when I generate Proxy/SARG report the for the previous day and it returns no log.

    Upon check the System Log, I have found this log:

    "php-fpm[69472]: /rc.start_packages: Checked cron job for /usr/pbi/squid-amd64/sbin/squid -k rotate -f /usr/pbi/squid-amd64/local/etc/squid/squid.conf, no change needed"

    I checked the Cron Jobs and I found this (This cron job was automatically added when you install squid.):

    0  0  * *  *  root  /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate

    Log rotation was empty in Squid.
    Log rotation in SquidGuard was unchecked.
    SARG schedules for Daily, Yesterday, Weekly Action - After Sarg were set to None (Default)
    SARG schedules for Monthly - Action After Sarg were set to Rotate Logs.

    I did the workaround, edited the cron to this:
    *0  0  /30  *  *  root  /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate

  • Banned

    No it wasn't installed with Remove the nonsense from your cron with the Cron package. There is no such feature any more in the Squid3 package. What you posted is some leftover from before 0.3.6 or so.

    0.4.0 will have a (non-configurable) swapstate_check.php cronjob that will run daily, it will do nothing though unless your drive is almost full or your swap.state is ungodly large.)

  • Thank you doktornotor for the reply.

  • By the way I have found this in squid.inc
    */ Handle cronjob install/uninstall */
    function squid_install_cron($should_install) {
    if (platform_booting()) {

    $cron_cmd = SQUID_BASE . "/sbin/squid -k rotate -f " . SQUID_CONFFILE;
    if (($should_install) && (squid_enabled())) {
    install_cron_job("{$cron_cmd}", $should_install, "0", "0", "", "", "*", "root");
    } else {
    install_cron_job("{$cron_cmd}", false);


  • Banned

    As you can notice there, that's a completely different command.

  • Is it that this line add the job to cron?

  • Banned

    You should not be adding anything anywhere manually. Remove the leftover

    /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-amd64/sbin/squid -k rotate

    cronjob and move on.

  • Sorry, but I have never added it manually. Actually I have deleted the cron job which I've seen present after the upgrading to Squid3 0.4.0 package.

    I don't know why.

  • Banned

    I have already told you 3 times that it's a leftover from Squid3 before 0.3.6. Remove it and move on.

  • @doktornotor:

    I have already told you 3 times that it's a leftover from Squid3 before 0.3.6. Remove it and move on.

    I always did. Thanks.