On 2015-07-13 Mon 13:25 PM |, Indunil Jayasooriya wrote:
> Hi mics,
>
>
> I want /etc/newsyslog.conf to generate /var/squid/logs/access.log daily.
> This is the entry I have added to /etc/newsyslog.conf file. But it does NOT
> work.
>
> */var/squid/logs/access.log _squid:_squid 640 14 *
> @T00 Z /var/squid/logs/squid.pid 30*
>
>
> any comments ?
>
Squid can rotate its own logs.
Search for 'rotate' in squid(8) and 'logfile_rotate' in
/usr/local/share/examples/squid/squid.conf.documented
Which says: "It is best to get in the habit of using
'squid -k rotate' instead of 'kill -USR1 <pid>'"
I use a monthly _squid cron job like this:
# ---------------------- 8< --------------------------
# crontab(5) ENVIRONMENT
# PATH (& umask) defined in /etc/login.conf
MAILTO=webmaster
# ENVIRONMENT debug:
# * * * * * logname; umask; pwd; printenv | sort
@monthly nice -n 20 squid -k rotate || print $?
# ---------------------- 8< --------------------------
Edit _squid's crontab with:
$ sudo su -l -s /bin/sh _squid -c 'crontab -e'
Cheers.
--
Drugs may be the road to nowhere, but at least they're the scenic route!