Log rotate squid

Basandosi su Logrotate:

Assicurarsi che sia settato il paramentro logfile_rotate 0 in squid.conf
Poi andare a modificare/visionare la configurazione sotto :

/etc/logrotate.d/squid

nel mio caso con poco traffico loggato faccio una rotazione mensile :

/var/log/squid/access.log {
monthly
rotate 12
copytruncate
compress
notifempty
missingok
}
/var/log/squid/cache.log {
weekly
rotate 5
copytruncate
compress
notifempty
missingok
}

/var/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
}

Log rotate squid

Leave a Reply

Your email address will not be published.