elasticsearch index cleanup script shell

 

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

# Cycle index cleanup expires
the while to true
do
the Read -p "Do you want to quit or continue to clean up the index? Exit [q], clean up [c] =>"
IF [$ a REPLY == "c"]
the then
the Read -p "Will you to clean days before the expiration index x [default:. 5] => "
CLEAR_DATE dATE + =`% D% Y.% -d $ m the REPLY. "days ago Member" `
echo 'will be cleared' index $ CLEAR_DATE 'date. ..... '
curl the -X-the DELETE' HTTP: // localhost: 9200 / * - '$ CLEAR_DATE> / dev / null 2>. 1 &
echo
elif [$ the REPLY == "Q"]
the then
Exit 0
the else
echo' the INPUT INVALID, ... Please Re-PUT '
Fi
DONE

 

log_expect.sh.bak

#!/usr/bin/expect -f
#spawn ssh [email protected]
expect "*103.30.4.4's password:"
send "lottery2018\n"
expect "*$"
interact

 

Guess you like

Origin www.cnblogs.com/immense/p/11402859.html