[CentOS] Slightly OT: Cron for Logrotate and Squid

Wed Sep 27 03:07:27 UTC 2006
Feizhou <feizhou at graffiti.net>

> and it's been suggested to do this in Cron, but it *does not* look right
> and is the part i'm most concerned about, I drew it slightly out of
> context from here:
> http://www.tldp.org/HOWTO/Bandwidth-Limiting-HOWTO/faq.html  It's the rm
> -f statement I worry about.
> 
> #SQUID - logrotate
> 01 4 * * * root /opt/squid/bin/squid -k rotate; /usr/sbin/logrotate
> /etc/logrotate.conf; /bin/rm -f /var/log/squid/*.log.0
> ####################################################################
> 
> Basically don't want to restart the squid daemon on my cache servers
> because it's just too too nasty of a proposition.
> 
> Any suggestions for the proper way to call logrotate from Cron with regard
> to squid in particular?
> 
squid can do its own log rotation...no need to involve logrotate.

squid -k rotate; gzip logfile.0 (multiple times as necessary)


If you want to use logrotate to do it, I suggest a completely separate 
logrotate configuration file for squid (squid-logrotate.conf)


logrotate squid-logrotate.conf