Search squid archive

automate flushing of cache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

Wondering if anyone has an automated cache-flushing script which can
be run as a cron job?

I know the system calls to actually flush the cache, but my problem is
that squid often takes a while to actually shut itself down.

I want to flush the entire cache every day at midnight.

I want to use something like this:

#!/usr/bin/perl
$shutdown_squid = `squid -k shutdown`;
$move_old_cache = `mv /var/spool/squid /var/spool/squidold`;
$make_new_cache = `mkdir /var/spool/squid`;
$change_cache_owner = `chown proxy:proxy /var/spool/squid`;
$rebuild_squid_cache = `squid -z`;
$start_squid = `squid -s`;
$delete_old_cache = `rm -rf /var/spool/squidold`;

But often it runs so quick that squid doesn't get chance to shutdown
before the script tries to restart it.

Any suggestions?

Thanks
Jim

[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux