亚洲免费乱码视频,日韩 欧美 国产 动漫 一区,97在线观看免费视频播国产,中文字幕亚洲图片

      1. <legend id="ppnor"></legend>

      2. 
        
        <sup id="ppnor"><input id="ppnor"></input></sup>
        <s id="ppnor"></s>

        Shell腳本實現(xiàn)精準清除Squid緩存

        字號:


            此腳本是在張宴的緩存清理腳本上做了修改的,主要是增加if選項,并根據(jù)$1參數(shù)類型來選擇性的列出緩存文件所在地址(因為$1并不固定,有時是特定的jpg類型,有時是域名)目前在自己的Squid緩存服務(wù)器上應(yīng)用,感覺采集緩存網(wǎng)址基本上沒什么誤差了,歡迎大家試用,爭取將此腳本做到更加完美(此腳本在Centos5.4 x86_64,Squid2.7下通過)腳本內(nèi)容如下:
            代碼如下:
            #!/bin/sh
            squidcache_path="/usr/local/squid/var/cache"
            squidclient_path="/usr/local/squid/bin/squidclient"
            if [[ "$1" =~ swf|png|jpg|ico|gif|css|js|htm|html|shtml ]]; then
            grep -a -r .$1 $squidcache_path/* | strings | grep "http:" | awk -F 'http:' '{print "http:"$2;}' |  awk -F\' '{print $1}' > cache.txt
            else
            grep -a -r $1 $squidcache_path/* | strings | grep "http:" | awk -F 'http:' '{print "http:"$2;}' |  awk -F\' '{print $1}' > cache.txt
            fi
            while read LINE
            do
            $squidclient_path -h 122.70.148.51 -p 80 -m PURGE $LINE
            done < cache.txt