Search squid archive

Re: How to clear old cache

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

 



From: Tech www <techwww@xxxxxxxxxxxx>
> I may suggest a fast way, given your cache_dir is /data/cache, and squid is 
> running with nobody, then do:
> 
> stop squid;
> mv /data/cache /data/cache0;
> chown -R nobody:nobody /data/cache;
> squid -z;
> start squid;
> rm -rf /data/cache0 &;

I think a mkdir is missing...
I wonder if, to minimize the downtime, the following would work:

mkdir /data/cache.new
chown nobody:nobody /data/cache.new
squid -z -f /etc/squid_conf_with_datadir_is_cache.new.conf
stop squid
mv /data/cache /data/cache.old
mv /data/cache.new /data/cache
start squid
rm -rf /data/cache.old

Could you even keep cache.new and just copy it as cache each time, so no need to squid -z each time...?

stop squid
mv /data/cache /data/cache.old
cp -a /data/cache.new /data/cache
start squid
rm -rf /data/cache.old

JD


      


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

  Powered by Linux