I can't remember where squid puts it's PID but if it does, then what you need to do is make a file called squid in /etc/logrotate.d/ which contains something like:
Code:
/var/log/squid/cache.log /var/log/squid/store.log {
missingok
sharedscripts
weekly
postrotate
/usr/bin/killall -HUP squid || true
endscript
}
What this does, is to take the /var/log/squid/cache.log and /var/log/squid/store.log and rotates them, the missingok stands for, should one of the logfiles be missing, it's not a big deal.. Sharedscripts, means that the kill line is only run once, else it will be run for every logfile mentioned. Weekly means, rotate every week (you could set this to daily if you like, but thats an awfull lot of rotates.) Since I don't know where squid puts it's PID I've decided to use the killall function, sending the HUP signal to any PID found for a process named squid (If this is what you chose, please ensure that squid will ba named squid, and not something like squid-run or /usr/sbin/squid) since in thos cases killall will claim theres no such running process. This can be done with a `ps aux |grep squid` which will as the last column show the actual name squid is using when running.
# > man 8 logrotate
will give you alot more info on how to use it, look under "CONFIGURATION FILE"
Bookmarks