squid清理cache

2021-05-18 10:06:12 浏览数 (1)

#!/bin/sh

squidcache_path="/var/squid/cache"

squidclient_path="/opt/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

$squidclient_path -m PURGE -h xxxxxxx -p 80 $url

done

0 人点赞