I am trying to use the curator tool to automate deleting older snapshots.
Up until now, I've been using the Elasticsearch API to create the snapshots instead of Curator.
Curator version: 3.5.1
The following:
curator --host `hostname -f` --port 9201 show snapshots --repository logstash_backup
produces a large list of snapshots, just over 200.
Sample:
ls_2016.04.11
ls_2016.04.12
ls_2016.04.13
ls_2016.04.14
ls_2016.04.15
ls_2016.04.16
ls_2016.04.17
Problem 1:
Matching by 'older-than' produces no results - I tried as low as 1 day as you can see in the example:
(13:45:37) PROD ->curator --host `hostname -f`show snapshots --repository logstash_backup --older-than 100 --time-unit days
2016-10-26 13:45:41,737 INFO Job starting: show snapshots
2016-10-26 13:45:41,885 WARNING No snapshots matched provided args.
No snapshots matched provided args.
(13:45:41) PROD ->curator --host `hostname -f` show snapshots --repository logstash_backup --older-than 1 --time-unit days
2016-10-26 13:45:46,101 INFO Job starting: show snapshots
2016-10-26 13:45:46,252 WARNING No snapshots matched provided args.
No snapshots matched provided args.
Problem 2:
Deleting by specific snapshot name using --snapshot ends up deleting all snapshots instead of just the one specified.
Example below using the 'show' option.
(13:45:46) PROD ->curator --host `hostname -f` --port 9201 show snapshots --repository logstash_backup --snapshot ls_2016.10.19
2016-10-26 13:46:10,868 INFO Job starting: show snapshots
2016-10-26 13:46:11,120 INFO Adding ls_2016.10.19 from command-line argument
2016-10-26 13:46:11,120 INFO Matching snapshots:
ls_2016.04.11
ls_2016.04.12
ls_2016.04.13
ls_2016.04.14
...
This goes on to list all my snapshots. I thought maybe it was seeing the '.' and matching all, so I tried escaping it, but it had no effect.
I did see that this was an issue in earlier Curator versions based on another discussion: Curator is deleting all snapshots
However, the only resolution there was to use older-than and I couldn't find any issues on the github project to match.
Any thoughts?
Thanks in advance