Search squid archive

Log Rotate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am running squid3-3.1.0.15-1 on CentOS.  I have this for log rotate:

/etc/logrotate.d/squid

/var/log/squid/access.log /var/log/squid/cache.log /var/log/squid/store.log {
    daily
    missingok
    nocompress
    noolddir
    sharedscripts
    postrotate
        DATE=`/bin/date --date=yesterday +%y%m%d`
        LOGDIR="/var/log/squid"
        /usr/sbin/squid -k rotate 2>/dev/null || true
        sleep 10
        for LOGFILE in ${LOGDIR}/*.log; do
          [ -f ${LOGFILE}.1 ] && mv ${LOGFILE}.1 ${LOGFILE}-${DATE}
          [ -f ${LOGFILE}-${DATE} ] && /bin/gzip ${LOGFILE}-${DATE}
        done
        /usr/bin/find ${LOGDIR}/ -type f -name "*.log-*.gz" -mtime +30
-exec rm -f {} \;
    endscript
}

It never seems to ratate the logs though.  Any idea why?

Matt

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux