zoukankan      html  css  js  c++  java
  • elasticsearch索引清理脚本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
    #----------------------------------------------

    #循环清理过期索引
    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 "
    expect "*$"
    interact

  • 相关阅读:
    P4999 烦人的数学作业
    P3413 SAC#1
    P2657 [SCOI2009]windy数
    P2602 [ZJOI2010]数字计数
    JSOI2007 建筑抢修
    CF161B Discounts
    Description
    Street Numbers
    Pizza Cutting
    Supermean
  • 原文地址:https://www.cnblogs.com/immense/p/11402859.html
Copyright © 2011-2022 走看看