es快照定时备份脚本

#!/bin/bash
data1=`date "+%Y%m%d"`
data2="http://0.0.0.0:9200/_snapshot/my_backup/snapshot_${data1}"

echo '-----------'
echo $data1
echo $data2
echo '----------'

curl -XPUT $data2


deldata1=`date -d "7 day ago" +"%Y%m%d"` //保留7天
deldata2="http://0.0.0.0:9200/_snapshot/my_backup/snapshot_${deldata1}"

curl -XDELETE $deldata2

echo "------------"

echo $deldata1
echo $deldata2
echo "-------"
You have new mail in /var/spool/mail/root

posted on 2018-05-09 14:28  net2817  阅读(608)  评论(0编辑  收藏  举报

导航