定期删除elasticsearch 的index 索引

#!/bin/bash
find /data/elasticsearch/data/pro-kz-log/nodes/0/indices/ -type d -mtime +7 | awk -F"/" '{print $9}' | grep -v kibana | uniq > /home/wwwad/.sh/esindex.txt
cat /home/wwwad/.sh/esindex.txt | while read line
do
echo ${line}
curl -XDELETE "http://10.19.10.61:9211/${line}"
done

posted @ 2017-08-29 09:47  BigBao的博客  阅读(2204)  评论(0编辑  收藏  举报