Re: [squid-users] Howto Clear Cache Periodicaly

From: Alexander Grüner <agruener@dont-contact.us>
Date: Tue, 11 Apr 2006 14:36:14 +0200

Hi :-)

> was wondering if there were a way to tell squid to clean cache
> periodicaly?! So I would not have to do it myself.

I am doing this with a cron job in the middle of the night. You might
adjust your paths perhaps. Downtime is just about a few seconds.

Works on SuSE Linux 9.2:

#!/bin/sh
#
# delete Squid Cache
# Alexander Grüner
#
#
killall -9 squid
rm /var/run/squid.pid
mv /var/cache/squid /var/cache/squid.old
mkdir /var/cache/squid
chown squid:root /var/cache/squid
squid -z 2>&1 | grep -v "Creating Swap"
rcsquid start 2>&1 | grep -v done
rm -rf /var/cache/squid.old

Perhaps there is even a better idea ?

Regards,
Alexander
Received on Tue Apr 11 2006 - 06:36:21 MDT

This archive was generated by hypermail pre-2.1.9 : Mon May 01 2006 - 12:00:02 MDT