定时删除elasticsearch的index

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

posted @ 2017-08-16 16:05  BigBao的博客  阅读(376)  评论(0编辑  收藏  举报