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 { weekly rotate 5 copytruncate compress notifempty missingok } /home/log/squid/Cache.log { weekly rotate 5 copytruncate compress notifempty missingok }
/home/log/squid/store.log { weekly rotate 5 copytruncate compress notifempty missingok # 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 logs postrotate /usr/sbin/squid -k rotate endscript }
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