squid 清缓存脚本(转)

squid 清缓存脚本(转)

#!/bin/sh

#cache_clean.sh swf
#cache_clean.sh sina.com.cn
#cache_clean.sh zhangyan.jpg

squidcache_path="/usr/local/squid/var/cache"
squidclient_path="/usr/local/squid/bin/squidclient"
grep -a -r $1 $squidcache_path/* | strings | grep "http:" | awk -F’http:’ ‘{print "http:"$2;}’ > cache_list.txt
for url in cat cache_list.txt; do
echo "$squidclient_path -m PURGE -p 80 $url"
$squidclient_path -m PURGE -p 80 $url
done

用法:

#cache_clean.sh swf

#cache_clean.sh sina.com.cn

#cache_clean.sh zhangyan.jpg

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注

14 − 9 =

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据