Curator snapshot rotation


#1

Hi,

can we do snapshot rotation concept using curator CLI tool if yes, please explain in detail how we can.

Thanks in advance.


(Aaron Mildenstein) #2

Yes.

https://www.elastic.co/guide/en/elasticsearch/client/curator/current/singleton-cli.html

In short:

curator_cli delete_snapshots --repository REPONAME --filter_list 'YOUR_FILTERS_HERE'

Your --filter_list will be up to you. It's where you'll specify the number of days your snapshots should last, etc.

Now, if you meant just the regular curator tool, and not specifically the curator_cli, then see this example yaml file for that specific purpose. It will also help you to see how the filters section becomes the --filter_list in the cli.


#3

Thank you for the response......

what exactly i need is to create snapshots automatically at some interval as well as delete older snapshots keeping a duplicate copy of older snapshots at so and so path

so that i created one yaml file with two actions one is creating snapshot the other action is deleting older snapshots and i run that yaml file in cronjob so that it can perform both the actions automatically

here is the yaml file...

actions:
  1:
    action: snapshot
    description: >-
      Snapshot logstash- prefixed indices older than 1 day (based on index
      creation_date) with the default snapshot name pattern of
      'curator-%Y%m%d%H%M%S'.  Wait for the snapshot to complete.  Do not skip
      the repository filesystem access check.  Use the other options to create
      the snapshot.
    options:
      repository: databackup
      name:
      ignore_unavailable: False
      include_global_state: True
      partial: False
      wait_for_completion: True
      skip_repo_fs_check: False
      disable_action: false
    filters:
    - filtertype: pattern
      kind: prefix
      value: twitter
    - filtertype: age
      source: creation_date
      direction: older
      unit: days
      unit_count: 1
  2:
    action: delete_snapshots
    description: >-
      Delete snapshots from the selected repository older than 30 seconds
      (based on creation_date), for 'curator-' prefixed snapshots.
    options:
      repository: databackup
      retry_interval: 30
      retry_count: 2
disable_action: false
    filters:
    - filtertype: pattern
      kind: prefix
      value: curator-
      exclude:
    - filtertype: age
      source: creation_date
      direction: older
      unit: seconds
      unit_count: 50

but i dont want to follow cronjob to create and delete snapshots automatically

please suggest any other option in curator to do that job without cronjob.

Thanks in Advance.


(Aaron Mildenstein) #4

There isn't one, at present. You would have to write your own scheduler or something of that nature to take the place of cron.


#5

Thank You.


(system) #6

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