[squid-users] Log rotate

sampei02 at tiscali.it sampei02 at tiscali.it
Mon Dec 7 08:12:02 UTC 2020


I want to rotate access.log by logrotate system process so I disabled rotation in squid.conf, logfile_rotate has been set to zero; by logrotate I can compress log files and to name them with date suffix.
But what I have to write among postrotate and endscript ? What command to send to squid to start rotation?
It’s right to write "squid -k rotate" in postrotate section if I wanted to manage rotation only by logrotate?


This is my /etc/logorotate.d/ file

var/log/squid/access.log {
        daily
        compress
        rotate 365
        missingok
        nocreate
        sharedscripts
        postrotate
		 test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate 2>/dev/null
        endscript
}





More information about the squid-users mailing list