{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/curator/issues/569","repository_url":"https://api.github.com/repos/elastic/curator","labels_url":"https://api.github.com/repos/elastic/curator/issues/569/labels{/name}","comments_url":"https://api.github.com/repos/elastic/curator/issues/569/comments","events_url":"https://api.github.com/repos/elastic/curator/issues/569/events","html_url":"https://github.com/elastic/curator/issues/569","id":135026075,"number":569,"title":"make `--time-unit months` more intuitive","user":{"login":"richm","id":23066,"avatar_url":"https://avatars.githubusercontent.com/u/23066?v=3","gravatar_id":"","url":"https://api.github.com/users/richm","html_url":"https://github.com/richm","followers_url":"https://api.github.com/users/richm/followers","following_url":"https://api.github.com/users/richm/following{/other_user}","gists_url":"https://api.github.com/users/richm/gists{/gist_id}","starred_url":"https://api.github.com/users/richm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/richm/subscriptions","organizations_url":"https://api.github.com/users/richm/orgs","repos_url":"https://api.github.com/users/richm/repos","events_url":"https://api.github.com/users/richm/events{/privacy}","received_events_url":"https://api.github.com/users/richm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-20T03:05:09Z","updated_at":"2016-03-07T21:20:46Z","closed_at":null,"body":"I just spent several hours going through the code to find out why index selection based on months wasn't working.\r\nFor example, if today is April 15, and you want to delete indices that are 2 months older than today e.g. project.2016.02.14 (--prefix project.* --time-unit months --older-than 2 --timestring %Y.%m.%d), curator doesn't delete indices that are dated older than February 15, it deletes indices older than _February 1_.  That is, it goes back to the first day of the current month, _then_ goes back two whole months from that date.  One consequence is that if you have a cron job running curator every day, it won't delete anything for a whole month, then on the first day of the month, it will delete a months worth of indices.  Another consequence is that there is no way to delete indices that are exactly N months older than the current date - you can delete N*30 days ago, or N*4 weeks ago, but that is not the same as N months ago.\r\nSince you can't very well fix `--time-unit months` without breaking existing usage of this counter-intuitive behavior, perhaps introduce another time unit e.g. `exact_months` or something like that.\r\n"},"comment":{"url":"https://api.github.com/repos/elastic/curator/issues/comments/193456430","html_url":"https://github.com/elastic/curator/issues/569#issuecomment-193456430","issue_url":"https://api.github.com/repos/elastic/curator/issues/569","id":193456430,"user":{"login":"untergeek","id":1020383,"avatar_url":"https://avatars.githubusercontent.com/u/1020383?v=3","gravatar_id":"","url":"https://api.github.com/users/untergeek","html_url":"https://github.com/untergeek","followers_url":"https://api.github.com/users/untergeek/followers","following_url":"https://api.github.com/users/untergeek/following{/other_user}","gists_url":"https://api.github.com/users/untergeek/gists{/gist_id}","starred_url":"https://api.github.com/users/untergeek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/untergeek/subscriptions","organizations_url":"https://api.github.com/users/untergeek/orgs","repos_url":"https://api.github.com/users/untergeek/repos","events_url":"https://api.github.com/users/untergeek/events{/privacy}","received_events_url":"https://api.github.com/users/untergeek/received_events","type":"User","site_admin":false},"created_at":"2016-03-07T21:20:46Z","updated_at":"2016-03-07T21:20:46Z","body":"> One consequence is that if you have a cron job running curator every day, it won't delete anything for a whole month, then on the first day of the month, it will delete a months worth of indices\r\n\r\nThis is incorrect. When using `--time-unit months`, each index is exactly 1 month, rather than counting days or weeks in a month.\r\n\r\nOf course, this will become semi-moot for future releases of Curator (but only with Elasticsearch 2.0+) where index ages will be determined by the Stats API, rather than only by the index name pattern."}}