[squid-users] Logrotate question

Amos Jeffries squid3 at treenet.co.nz
Fri Jun 17 23:10:03 UTC 2022


On 18/06/22 07:06, robert k Wild wrote:
>   i understand it now
> 

Er, no.

> cat /etc/logrotate.d/squid
> /usr/local/squid/var/logs/*.log {
...
> postrotate
> /usr/local/squid/sbin/squid -k reconfigure
> endscript
> }
> 
> needed the sharedscripts to run the postrotate just once for all logs
> 
> didnt need the squid -k rotate as already handled by logrotate
> 

The "-k rotate" tells Squid to open and start writing to the new log 
files created by logrotate tool.

That "-k reconfigure" you have chosen is a far more complicated and slow 
operation. It is not guaranteed to change the files Squid is writing to.


PS. you also need to configure "logfile_rotate 0" for self-built Squid 
to prevent it doing any log file renumbering when logrotated is used.

Amos


More information about the squid-users mailing list