Squid log file is too large, how to deal with it?

  
 

Squid is compressed once in the default of 5 days, and is set in /etc/logrotate.d/squid. If you change the location of the log,

Please modify /etc/logrotate.d/squid

/home/log/squid/access.log {weeklyrotate 5copytruncatecompressnotifemptymissingok}/home/log/squid /cache.log {weeklyrotate 5copytruncatecompressnotifemptymissingok}

/home/log/squid/store.log {weeklyrotate 5copytruncatecompressnotifemptymissingok# This script asks squid to rotate its logs on its own.# Restarting squid is a long process and it is Not worth# doing it just to rotate logspostrotate/usr/sbin/squid -k rotateendscript}

First modify squid.conf

logfile_rotate 3 (retain several logs)

Modify /etc/crontab

0 0 * * * squid /home/squid/sbin/squid -k rotate

(compressed once a day)

crontab /etc/crontab (crontab effective)

Copyright © Windows knowledge All Rights Reserved