# Snapshot newly created indices

**URL:** <https://discuss.elastic.co/t/snapshot-newly-created-indices/159428>\
**Category:** Elasticsearch\
**Created:** [December 4, 2018, 10:48pm UTC](https://discuss.elastic.co/t/snapshot-newly-created-indices/159428 "2018-12-04T22:48:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpendela](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@rpendela](https://discuss.elastic.co/u/rpendela)\
**Post date:** [December 4, 2018, 10:48pm UTC](https://discuss.elastic.co/t/snapshot-newly-created-indices/159428/1 "2018-12-04T22:48:18Z")

</div>

Hello Community,

I have quick question on Curator snapshot. I configured curator and working fine. Now I want to take snapshot on daily basis but delete snapshots on server for every 90days.

so here is my current action file.

```
actions:
1:
    action: snapshot
    description: >-
        create snapsht for listed indexes in s3-backup repository
    options:
      repository: test
      name: elk-%Y%m%d%H%M
      continue_if_exception: False
      ignore_unavailable: False
      wait_for_completion: False
      wait_interval: 10
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(.s|.l|.m|.w|.k|.t|m).*$'
      exclude: True
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 1
2:
    action: delete_indices
    description: >-
        delete indexes listed indexes in s3-corp repository
    options:
      continue_if_exception: False
      ignore_empty_list: True
    filters:
    - filtertype: pattern
      kind: regex
      value: '^(.s|.l|.m|.w|.k|.t).*$'
      exclude: True
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 90

```

but in this process already snapshotted indices adding in to new snapshot that creates each day. so I want know how to configure to take only snapshot of the indices which are not snapshotted earlier.

Also,  
I want to take only previous day snapshots on daily basis.

Thanks,

---

<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:** [December 5, 2018, 5:02pm UTC](https://discuss.elastic.co/t/snapshot-newly-created-indices/159428/2 "2018-12-05T17:02:09Z")

</div>

Just add an additional `age` filter under your `older` one:

```auto
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 1
    - filtertype: age
      source: creation_date
      direction: younger
      unit: days
      unit_count: 2

```

Depending on when you run it, you might need to set `younger` to `3` days.

---

<div class="post-metadata">

**Author:** ![rpendela](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@rpendela](https://discuss.elastic.co/u/rpendela)\
**Post date:** [December 10, 2018, 5:46pm UTC](https://discuss.elastic.co/t/snapshot-newly-created-indices/159428/3 "2018-12-10T17:46:26Z")

</div>

That worked. Thanks

---

<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:** [January 7, 2019, 5:46pm UTC](https://discuss.elastic.co/t/snapshot-newly-created-indices/159428/4 "2019-01-07T17:46:29Z")

</div>

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