#!/bin/sh squidcache_path="/data/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 $squidclient_path -h 192.168.199.150 -p 80 -m PURGE $url ##修改对应主机IP done
执行脚本: sh clean.sh ".rar" 则删除后缀为rar的缓存文件
本文由 Mr Gu 创作,采用 知识共享署名4.0 国际许可协议进行许可
本站文章除注明转载/出处外,均为本站原创或翻译,转载前请务必署名
最后编辑时间为: Oct 12, 2016 at 03:02 pm