Created
December 6, 2021 17:24
-
-
Save tonmanna/dfa0c67734670d45a92d753d0d9f50e5 to your computer and use it in GitHub Desktop.
ElasticSearch Backup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://coralogix.com/blog/tutorial-elasticsearch-snapshot-lifecycle-management-slm/ | |
curl -X PUT http://localhost:30265/_snapshot/repository -H 'Content-Type: application/json' -d '{"type": "url", "settings": { "url": "file:/backup" }}' | |
curl -X PUT "localhost:30265/_snapshot/repository?pretty" -H 'Content-Type: application/json' -d'{"type": "fs","settings": {"location": "backup_repo" }' | |
curl -X GET 'http://localhost:30265/_snapshot/backup_repository' | |
curl -X PUT 'http://localhost:30265/_snapshot/backup_repository' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"type": "fs", | |
"settings": { | |
"location": "/usr/share/elasticsearch/backup" | |
} | |
}' | |
curl -X PUT 'http://localhost:30265/_slm/policy/backup_policy_daily' \ | |
-H 'Content-Type: application/json' \ | |
-d '{ | |
"schedule": "0 03 3 * * ?", | |
"name": "<backup-{now/d}>", | |
"repository": "backup_repository", | |
"config": { | |
"indices":["*"] | |
}, | |
"retention": { | |
"expire_after": "60d" | |
} | |
}' | |
curl --location --request POST 'http://localhost:30265/_slm/policy/backup_policy_daily/_execute' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment