#!/bin/sh
#auth by yx 20140808
#purge nginx cache
CACHE_DIR="/data/web/cache"
FILE="$*"
if [ $# -eq 0 ];then
echo "please run \"sh $0 index.html index.jsp ....\""
exit
fi
for i in `echo $FILE`
do
grep -ra $i ${CACHE_DIR}| awk -F ":" ‘{print $1}‘ >./cache_list.txt
for j in `cat ./cache_list.txt`
do
rm -rf $j
done
done
nginx 批量删除cache,布布扣,bubuko.com
原文地址:http://iltxin.blog.51cto.com/5864827/1537279