# How to automatically delete older snapshot?

**URL:** <https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711>\
**Category:** Elasticsearch\
**Created:** [June 27, 2019, 4:24am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711 "2019-06-27T04:24:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 27, 2019, 4:24am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/1 "2019-06-27T04:24:55Z")

</div>

Hi, I'm wondering if there's a way to automate deletion of older snapshots? One of the ways I tried is to run this daily with systemd timer (the date is incremented by a day every day):

```auto
DELETE /_snapshot/backup/2019-02-01*

```

But it returns me this:

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "snapshot_missing_exception",
        "reason" : "[backup:snapshot-2019-02-01*] is missing"
      }
    ],
    "type" : "snapshot_missing_exception",
    "reason" : "[backup:2019-02-01*] is missing"
  },
  "status" : 404
}

```

Is there any other way that you guys recommend? 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:** [June 27, 2019, 5:42am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/2 "2019-06-27T05:42:31Z")

</div>

Curator can probably help.

And in the future:

> <https://github.com/elastic/elasticsearch/issues/38461>

---

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 27, 2019, 6:23am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/3 "2019-06-27T06:23:39Z")

</div>

Hi @dadoonet

Is Curator guaranteed to be compatible with latest version of Elasticsearch? The last time I tried Curator, it couldn't delete the old indices after upgrading to the latest Elasticsearch.

---

<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:** [June 27, 2019, 6:35am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/4 "2019-06-27T06:35:22Z")

</div>

Curator is compatible yes. But here I feel like the issue was more within elasticsearch itself between old and new snapshots whatever the tool you are using to access them (curl or curator).

---

<div class="post-metadata">

**Author:** ![aqiank](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aqiank/32/39723_2.png) [@aqiank](https://discuss.elastic.co/u/aqiank)\
**Post date:** [June 27, 2019, 7:09am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/5 "2019-06-27T07:09:30Z")

</div>

OK, thanks! I'll try Curator again.

---

<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 25, 2019, 7:09am UTC](https://discuss.elastic.co/t/how-to-automatically-delete-older-snapshot/187711/6 "2019-07-25T07:09:34Z")

</div>

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