# Elastic index snapshot and restore daily

**URL:** https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358
**Category:** Elasticsearch
**Created:** [August 5, 2016, 2:54pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358 "2016-08-05T14:54:38Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![newelasticuser](https://avatars.discourse-cdn.com/v4/letter/n/50afbb/32.png) [@newelasticuser](https://discuss.elastic.co/u/newelasticuser)
#### Post date: [August 5, 2016, 2:54pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/1 "2016-08-05T14:54:38Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)
#### Post date: [August 5, 2016, 3:01pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/2 "2016-08-05T15:01:14Z")

</div>

> [@newelasticuser](#):
>
> Is it possible to snapshot the index by date and time?

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.

---

<div class="post-metadata">

### Author: ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)
#### Post date: [August 5, 2016, 3:18pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/3 "2016-08-05T15:18:42Z")

</div>

Have you looked at [Elasticsearch Curator](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/index.html)? It has [snapshot](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/snapshot.html) and [restore](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/restore.html) actions, and is designed to be run via cron.

---

<div class="post-metadata">

### Author: ![newelasticuser](https://avatars.discourse-cdn.com/v4/letter/n/50afbb/32.png) [@newelasticuser](https://discuss.elastic.co/u/newelasticuser)
#### Post date: [August 5, 2016, 4:22pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/4 "2016-08-05T16:22:49Z")

</div>

If I use the snapshot api  
[https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-snapshots.html](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?

---

<div class="post-metadata">

### Author: ![jasontedor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasontedor/32/66992_2.png) [@jasontedor](https://discuss.elastic.co/u/jasontedor)
#### Post date: [August 5, 2016, 4:27pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/5 "2016-08-05T16:27:20Z")

</div>

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

---

<div class="post-metadata">

### Author: ![niraj\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_kumar/32/4130_2.png) [@niraj\_kumar](https://discuss.elastic.co/u/niraj_kumar)
#### Post date: [August 5, 2016, 4:43pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/6 "2016-08-05T16:43:36Z")

</div>

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/](http://localhost:9200/)_snapshot/mys3\_repository/my\_backup_`date -u +%Y%m%dt%H%M%S`?pretty" -d '{}'

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 5, 2017, 10:29pm UTC](https://discuss.elastic.co/t/elastic-index-snapshot-and-restore-daily/57358/7 "2017-07-05T22:29:43Z")

</div>


