<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Example Shell Script :: Ay Docs</title>
    <link>https://ops.docs.72602.space/buckup/elasticsearch/example_shell_script/index.html</link>
    <description>Init ES Backup Setting create an ES backup setting in s3, and make an snapshot after creation&#xA;#!/bin/bash ES_HOST=&#34;http://192.168.58.2:30910&#34; ES_BACKUP_REPO_NAME=&#34;s3_fs_repository&#34; S3_CLIENT=&#34;default&#34; ES_BACKUP_BUCKET_IN_S3=&#34;es-snapshot&#34; ES_SNAPSHOT_TAG=&#34;auto&#34; CHECK_RESPONSE=$(curl -s -k -X POST &#34;$ES_HOST/_snapshot/$ES_BACKUP_REPO_NAME/_verify?pretty&#34; ) CHECKED_NODES=$(echo &#34;$CHECK_RESPONSE&#34; | jq -r &#39;.nodes&#39;) if [ &#34;$CHECKED_NODES&#34; == null ]; then echo &#34;Doesn&#39;t exist an ES backup setting...&#34; echo &#34;A default backup setting will be generated. (using &#39;$S3_CLIENT&#39; s3 client and all backup files will be saved in a bucket : &#39;$ES_BACKUP_BUCKET_IN_S3&#39;&#34; CREATE_RESPONSE=$(curl -s -k -X PUT &#34;$ES_HOST/_snapshot/$ES_BACKUP_REPO_NAME?pretty&#34; -H &#39;Content-Type: application/json&#39; -d &#34;{\&#34;type\&#34;:\&#34;s3\&#34;,\&#34;settings\&#34;:{\&#34;bucket\&#34;:\&#34;$ES_BACKUP_BUCKET_IN_S3\&#34;,\&#34;client\&#34;:\&#34;$S3_CLIENT\&#34;}}&#34;) CREATE_ACKNOWLEDGED_FLAG=$(echo &#34;$CREATE_RESPONSE&#34; | jq -r &#39;.acknowledged&#39;) if [ &#34;$CREATE_ACKNOWLEDGED_FLAG&#34; == true ]; then echo &#34;Buckup setting &#39;$ES_BACKUP_REPO_NAME&#39; has been created successfully!&#34; else echo &#34;Failed to create backup setting &#39;$ES_BACKUP_REPO_NAME&#39;, since $$CREATE_RESPONSE&#34; fi else echo &#34;Already exist an ES backup setting &#39;$ES_BACKUP_REPO_NAME&#39;&#34; fi CHECK_RESPONSE=$(curl -s -k -X POST &#34;$ES_HOST/_snapshot/$ES_BACKUP_REPO_NAME/_verify?pretty&#34; ) CHECKED_NODES=$(echo &#34;$CHECK_RESPONSE&#34; | jq -r &#39;.nodes&#39;) if [ &#34;$CHECKED_NODES&#34; != null ]; then SNAPSHOT_NAME=&#34;meta-data-$ES_SNAPSHOT_TAG-snapshot-$(date +%s)&#34; SNAPSHOT_CREATION=$(curl -s -k -X PUT &#34;$ES_HOST/_snapshot/$ES_BACKUP_REPO_NAME/$SNAPSHOT_NAME&#34;) echo &#34;Snapshot $SNAPSHOT_NAME has been created.&#34; else echo &#34;Failed to create snapshot $SNAPSHOT_NAME .&#34; fi</description>
    <generator>Hugo</generator>
    <language>en</language>
    <lastBuildDate></lastBuildDate>
    <atom:link href="https://ops.docs.72602.space/buckup/elasticsearch/example_shell_script/index.xml" rel="self" type="application/rss+xml" />
  </channel>
</rss>