首页 > 系统服务 > 详细

elasticsearch索引清理脚本shell

时间:2019-08-24 00:18:40      阅读:109      评论:0      收藏:0      [点我收藏+]

 

es-index-clear.sh

#!/bin/bash
#----------------------------------------------
# Module: es-index-clear
# Comment: To clear elastic-index on interval!
# Date: 2018/10/5
# Author: aodi
# Version: 1.0
#----------------------------------------------

#循环清理过期索引
while true
do
read -p "请问您要退出还是继续清理索引? 退出[q],清理[c] => "
if [ $REPLY == "c" ]
then
read -p "请问你要清理x天前的过期索引[默认:5] => "
CLEAR_DATE=`date +%Y.%m.%d -d $REPLY" days ago"`
echo ‘即将清理‘$CLEAR_DATE‘日期的索引......‘
curl -X DELETE ‘http://localhost:9200/*-‘$CLEAR_DATE >/dev/null 2>&1
echo
elif [ $REPLY == "q" ]
then
exit 0
else
echo ‘INPUT INVALID,please re-put...‘
fi
done

 

log_expect.sh.bak

#!/usr/bin/expect -f
#spawn ssh lottery@103.30.4.144
expect "*103.30.4.4‘s password:"
send "lottery2018\n"
expect "*$"
interact

 

elasticsearch索引清理脚本shell

原文:https://www.cnblogs.com/immense/p/11402859.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!