#!/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 ====