How to change snapshot base path without modifying the repository?

Hi everyone,

I want to make snapshots of my cluster to be stored in a different base path or different folder without changing the base path of the repository that I'm making the snapshot.

I use the azure repository plugin to make my snapshots into a container that is in a storage account.

My plan is to have snapshots of the last 7 days to be retained into my storage account and have them be separated into different folders when the snapshot is created into the storage account.

For example a folder where the snapshot is stored might have this sort of template:
backup-backupYear-backupMonth-backupDay

However for the moment I have to modify the repository every time I create the snapshot in order for the snapshot to be stored into a different folder(base path).

    {
      "repository" : {
        "type" : "azure",
        "settings" : {
          "container" : "backup-repo",
          "base_path" : "yyyy-mm-dd",
          "chunk_size" : "64mb",
          "compress" : "true"
        }
      }
    }

Is there a way to change the base_path at the moment i create the snapshot?

If not is there any other way where i can keep the last 7 days of snapshots and deleting snapshots that are older than 7 days in my storage account?

The reason i want to change the base path is that i can use lifecycle rules in my storage account to move snapshots from one tier of storage to another, or delete it all together.

If there is another way to achieve what I'm asking I'll be glad to hear it.

Thank you beforehand.

No, but I don't think you want to do this. Snapshots are incremental within a repository, but if you move to a new base_path then you're effectively using a new repository so will be duplicating a lot of data.

Yes, it sounds like you are looking for SLM.

1 Like

Thank you that's exactly what i needed.

I went and did the policy for SLM in Kibana in the management section and then went to the snapshot and restore part. It was very easy to setup.

Thank you again for you quick response.

2 Likes

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