# Snapshot - Repository S3 (Strategy)

**URL:** https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184
**Category:** Elasticsearch
**Created:** [October 9, 2017, 7:23am UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184 "2017-10-09T07:23:52Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![lazam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lazam/32/34587_2.png) [@lazam](https://discuss.elastic.co/u/lazam)
#### Post date: [October 9, 2017, 7:23am UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/1 "2017-10-09T07:23:54Z")

</div>

Hi!

I'm doing a backup in our S3. So far we're using a monthly index, but we're planning to do a daily backup using curator.

Versions:

- Elasticsearch 5.6.1
- Curator 5.2

Here are some questions:

1. Is it good to do a daily snapshot for each index ?
2. Using the curator filters, is it possible to grab the current date? because when using timestring and regex, it still grabs all the similar pattern which is index-YEAR-MONTH.
3. For snapshot, is it okay to include old indices even it will be deleted since I'm going to create snapshot based from creation time
4. Since we're using a monthly index, we expect to create a snapshot while there's an on-going index. Based from the docs, this shouldn't be an issue.

Thanks!

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [October 9, 2017, 8:48am UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/2 "2017-10-09T08:48:57Z")

</div>

> 1. Is it good to do a daily snapshot for each index ?

On [cloud.elastic.co](http://cloud.elastic.co) we are doing snapshot every 30 minutes. Everyday is fine.

> 1. Using the curator filters, is it possible to grab the current date? because when using timestring and regex, it still grabs all the similar pattern which is index-YEAR-MONTH.

I don't know. @theuntergeek probably can help.

> 1. For snapshot, is it okay to include old indices even it will be deleted since I'm going to create snapshot based from creation time

Not sure I understood.

> 1. Since we're using a monthly index, we expect to create a snapshot while there's an on-going index. Based from the docs, this shouldn't be an issue.

Not an issue indeed. Only data available at the moment you start the snapshot will be saved though.

---

<div class="post-metadata">

### Author: ![lazam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lazam/32/34587_2.png) [@lazam](https://discuss.elastic.co/u/lazam)
#### Post date: [October 9, 2017, 9:12am UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/3 "2017-10-09T09:12:53Z")

</div>

Awesome! Thanks for answering the questions.

For number 3, Let's say I have the following indices:

- index-2017-07
- index-2017-08
- index-2017-09
- index-2017-10

Since I'm planning to create a daily snapshot it will look like this:

```
"snapshot" : "index-backup-2017-10-09",
  "uuid" : "xxxxxxxxxxxxxxxxxx",
  "version_id" : xxxxxxx,
  "version" : "5.6.1",
  "indices" : [
    "index-2017-09",
    "index-2017-10",
    "index-2017-07",
    "index-2017-08"
  ],

```

Since I only need around 3 months worth of data, I plan to delete indices which are older than 3 months. Let's say it's already November, the index-2017-07 will be deleted. Will that affect the snapshot created when index-2017-07 is present? Based from the docs, it shouldn't since it's incremental.

---

<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: [October 9, 2017, 10:24pm UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/4 "2017-10-09T22:24:17Z")

</div>

> [@dadoonet](#):
>
> Using the curator filters, is it possible to grab the current date? because when using timestring and regex, it still grabs all the similar pattern which is index-YEAR-MONTH.

I don't understand the question. Can you please rephrase this?

> [@lazam](#):
>
> For number 3, Let's say I have the following indices:

To understand better how snapshots work, I recommend reading [this comment on GitHub](https://github.com/elastic/curator/issues/174#issuecomment-57056621).

---

<div class="post-metadata">

### Author: ![lazam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lazam/32/34587_2.png) [@lazam](https://discuss.elastic.co/u/lazam)
#### Post date: [October 10, 2017, 2:26am UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/5 "2017-10-10T02:26:26Z")

</div>

For the curator part, let's say I have index named "filebeat-%Y-%m". So far, I have indices for filebeat starting June which results to indices below:

- filebeat-2017-06
- filebeat-2017-07
- filebeat-2017-08
- filebeat-2017-09
- filebeat-2017-10

Right now it's October, Is there a way in curator to just grab the current month which is October and do a snapshot of it? or that's a not good thing since if I'm doing a backup daily then it doesn't matter if I include all filebeat-%Y-%m indices since it's incremental.

---

<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: [October 10, 2017, 1:35pm UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/6 "2017-10-10T13:35:52Z")

</div>

> [@lazam](#):
>
> Is there a way in curator to just grab the current month (which is October) and do a snapshot of it?

Yes. See the [period filter](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.2/filtertype_period.html)

```auto
---
actions:
  1:
    action: snapshot
    # snapshot settings and options go here
    # ...
    filters:
      - filtertype: pattern
        kind: prefix
        value: filebeat-
      - filtertype: period
        source: name
        range_from: 0
        range_to: 0
        timestring: '%Y.%m'
        unit: months

```

This example will select the current month's filebeat index (which are presumed to be named with a monthly timestamp) and perform a snapshot of it.

---

<div class="post-metadata">

### Author: ![lazam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lazam/32/34587_2.png) [@lazam](https://discuss.elastic.co/u/lazam)
#### Post date: [October 10, 2017, 2:33pm UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/7 "2017-10-10T14:33:01Z")

</div>

Awesome! It looks like I missed out the period filter in the docs.  
Thanks for bringing that one!

---

<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: [November 7, 2017, 2:33pm UTC](https://discuss.elastic.co/t/snapshot-repository-s3-strategy/103184/8 "2017-11-07T14:33:21Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
