void

批量清除Squid缓存的小工具

很实用的一个清除squid缓存的小工具:
http://www.wa.apana.org.au/~dean/squidpurge/

wget http://www.wa.apana.org.au/~dean/sources/purge-20040201-src.tar.gz
tar zxvf purge-20040201-src.tar.gz
cd purge
make
[root@cache purge]# ./purge -help
### Use at your own risk! No guarantees whatsoever. You were warned. ###

$Id: purge.cc,v 1.17 2000/09/21 10:59:53 cached Exp $
Usage: purge   [-a] [-c cf] [-d l] [-(f|F) fn | -(e|E) re] [-p h[:p]]
                [-P #] [-s] [-v] [-C dir [-H]] [-n]

-a     display a little rotating thingy to indicate that I am alive (tty only).
-c c   squid.conf location, default "/usr/local/squid/etc/squid.conf".
-C dir base directory for content extraction (copy-out mode).
-d l   debug level, an OR of different debug options.
-e re single regular expression per -e instance (use quotes!).
-E re single case sensitive regular expression like -e.
-f fn name of textfile containing one regular expression per line.
-F fn name of textfile like -f containing case sensitive REs.
-H     prepend HTTP reply header to destination files in copy-out mode.
-n     do not fork() when using more than one cache_dir.
-p h:p cache runs on host h and optional port p, default is localhost:3128.
-P #   if 0, just print matches; otherwise OR the following purge modes:
           0x01 really send PURGE to the cache.
           0x02 remove all caches files reported as 404 (not found).
           0x04 remove all weird (inaccessible or too small) cache files.
        0 and 1 are recommended - slow rebuild your cache with other modes.
-s     show all options after option parsing, but before really starting.
-v     show more information about the file, e.g. MD5, timestamps and flags.

1.清除URL中包含jackbillow.com的所有缓存
./purge -p 127.0.0.1:80 -P 1 -se 'jackbillow.com'

2.清除 URL 以“.mp3”结尾的缓存文件,例如:http://www.jackbillow.com/abc/test.mp3
./purge -p 127.0.0.1:80 -P 1 -se '\.mp3$'

posted on 2009-06-26 10:17 void 阅读(619) 评论(0)  编辑  收藏 所属分类: Squid


只有注册用户登录后才能发表评论。


网站导航: