码迷,mamicode.com
首页 > 其他好文 > 详细

es备份

时间:2018-04-28 15:53:33      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:10.10   bin   date   color   div   tar   esb   back   day   

#!/bin/bash

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

Ip=10.0.10.10
Date=$(date +"%Y%m%d")
Hour=$(date +"%H")
Hour24=$(date +"%H" -d "24 hours ago")
Date_1day=$(date +"%Y%m%d" -d "24 hours ago")

echo ==== test esbak $(date +"%F %T") snap start ====
curl -XPUT http://$Ip:9200/_snapshot/my_backup/snapshot_${Date}_${Hour}
echo ==== test esbak $(date +"%F %T") snap end ====

sleep 120

echo ==== test esbak $(date +"%F %T") snap delete start ====
curl -XDELETE http://$Ip:9200/_snapshot/my_backup/snapshot_${Date_1day}_${Hour24}
echo ==== test esbak $(date +"%F %T") snap delete end ====

 

es备份

标签:10.10   bin   date   color   div   tar   esb   back   day   

原文地址:https://www.cnblogs.com/mikeluwen/p/8967668.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!