How to automatically delete older snapshot?

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):

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

But it returns me this:

{
  "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!

Curator can probably help.

And in the future:

1 Like

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.

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).

OK, thanks! I'll try Curator again.

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