Automatically delete snapshots created by ISM policy

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):

OpenSearch 2.13

Describe the issue:

I’ve a ISM policy to take snapshot and delete indices on certain conditions. Now I want to delete those snapshots after sometime, all I could find was manual deletion. Wanted to check is there any automated way to delete those snapshots?

Hey @PrasanthG

You need to set the schedule for your automatic snapshots using a cron expression.

example:

POST _plugins/_sm/policies/daily-policy
{
  "description": "Daily snapshot policy",
  "creation": {
    "schedule": {
      "cron": {
        "expression": "0 8 * * *",
        "timezone": "UTC"
      }
    },
    "time_limit": "1h"
  },
  "deletion": {
    "schedule": {
      "cron": {
        "expression": "0 1 * * *",
        "timezone": "America/Los_Angeles"
      }
    },
1 Like

Thanks for the response.

But I want to use the ISM policy because it allows me to take snapshot and delete the index after that. Also I have set some criteria to take snapshots before deleting the index.

It is not possible with SM policies.

Hey @PrasanthG

You can configure CRON in your SM as shown above to set date and time for your snapshots and/or delete them, your ISM policy is separate. My guess would be is to corresponded the snapshots with your ISM policy.

Let me try this! thanks :slight_smile:

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