I am fairly new to ElasticSearch and was trying to do some backup and
restore using the API. I wrote a shell script to remove snapshots older
than certain days but it somehow removes the repo instead of the snapshots
info stored in a variable. Any help would be appreciated:
#Remove snapshots older than 7 days
cd /snapshot/directory
OLD_BACKUP=find snapshot-* -mtime +7
OLD_SNAPSHOT=for filename in ${OLD_BACKUP}; do [ -f "$filename" ] || continue mv $filename ${filename//snapshot-/} done
for each snapshot, if it's older than 7 days, delete the snapshot
Le mardi 20 janvier 2015 19:19:38 UTC-2, abutalib zaidi a écrit :
I am fairly new to Elasticsearch and was trying to do some backup and
restore using the API. I wrote a shell script to remove snapshots older
than certain days but it somehow removes the repo instead of the snapshots
info stored in a variable. Any help would be appreciated:
#Remove snapshots older than 7 days
cd /snapshot/directory
OLD_BACKUP=find snapshot-* -mtime +7
OLD_SNAPSHOT=for filename in ${OLD_BACKUP}; do [ -f "$filename" ] || continue mv $filename ${filename//snapshot-/} done
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.