Elastic index snapshot and restore daily

Is it possible to snapshot the index by date and time?
Wanted to know if snapshots can be done by date and time and can it be restored for particular date and time?
What's the syntax for backingup by date and time using the API?

1 Like

A snapshot is a backup of a point in time.

You get to give it a name of your choosing but a date and time are probably a sensible naming convention to adopt.

Have you looked at Elasticsearch Curator? It has snapshot and restore actions, and is designed to be run via cron.

If I use the snapshot api
https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html,
do I need to schedule it or is there any configuration set to run it on schedule?

There is no configuration to run it on a schedule, you have to do that externally.

You can setup a cron to do that , may be sometime when you feel the load on the instance will be low. Run that as a script with cron.

eg:-

curl -XPUT "http://localhost:9200/snapshot/mys3_repository/my_backupdate -u +%Y%m%dt%H%M%S?pretty" -d '{}'