Re: [squid-users] how to call external program for each cached file?

From: Donovan Baarda <abo@dont-contact.us>
Date: Fri, 2 Aug 2002 09:51:11 +1000

On Thu, Aug 01, 2002 at 02:51:33PM -0500, Michael wrote:
> I want to call a shell script each time Squid caches a file. Is there a
> way to do this built in already or can anyone suggest the best way I could
> add this into my copy of Squid? Up to now I've been using a cron job every
> 5 minutes to find files recently modified by Squid but that is somewhat
> resource intensive and still occassionally misses things. Thanks.

You could try using a redirector... this will effectively call an external
program for each request, telling you what is requested. This _wont_ tell
you if the request will be a hit or miss or whatever, nor will it tell you
when the request is completed. However, knowing what is requested might be
useful enough.

Another option is to tail access.log... This will tell you what was served,
including hit/miss/whatever, and it will tell you _after_ the request is
completed. However, it won't tell you when/if the request is actually
written to disk.

Tailing store.log will tell you what is fetched, written, and cleared from
the disk. It won't tell you the file it was written too though.

The other thing with tailing logfiles is log-rotation... you'll need to make
sure it doesn't stuff you up. I believe there is at least one "logtail"
utility that can handle this for you.

-- 
----------------------------------------------------------------------
ABO: finger abo@minkirri.apana.org.au for more info, including pgp key
----------------------------------------------------------------------
Received on Thu Aug 01 2002 - 17:51:26 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:09:30 MST