首页 > 技术文章 > 定时删除elasticsearch的index

smail-bao 2017-08-16 16:05 原文

#!/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

推荐阅读