Crontab and Elasticsearch-curator version 5.0.4


(Yecci) #1

Hello!

When we are using the Curator for deleting indices manually, it works without any problems.

curator ./delete_index.yml --config ./curator.yml

2017-05-24 11:35:21,339 INFO Preparing Action ID: 1, "delete_indices"
2017-05-24 11:35:21,342 INFO Trying Action ID: 1, "delete_indices": Delete indices older than 10 days (based on index name), for logstash- prefixed indices. Ignore the error if the filter does not result in an actionable list of indices (ignore_empty_list) and exit cleanly.
2017-05-24 11:35:21,401 INFO Deleting selected indices: [u'example-2017-05-15', u'csvindex-2017-05-15']
2017-05-24 11:35:21,401 INFO ---deleting index example-2017-05-15
2017-05-24 11:35:21,401 INFO ---deleting index csvindex-2017-05-15
2017-05-24 11:35:21,494 INFO Action ID: 1, "delete_indices" completed.
2017-05-24 11:35:21,494 INFO Job completed.

But when we want to schedule this in cron, by typing crontab -e (This is just an example)
48 09 * * * root curator /home/kristofferprojekt/.curator/delete_index.yml --config /home/kristofferprojekt/.curator/curator.yml

Then it shows the following information in syslog:

May 24 09:48:01 kristofferprojekt- CRON[4580]: (kristofferprojekt) CMD (root curator /home/kristofferprojekt/.curator/delete_index.yml --config /home/kristofferprojekt/.curator/curator.yml)

So the cronjob seems to be working, but the indices that are suppose to be deleted still exist.
These are the version we are using for elasticsearch and curator:

Elasticsearch-curator version: 5.0.4
Elasticsearch version: 5.4.0

We would really like to make this solution work so we don't need to manually delete indices.

Can anyone help us out?

Thanks in advance!


(Aaron Mildenstein) #2

What version of cron are you using? I've never seen this syntax before:

48 09 * * * root curator /home/kristofferprojekt/.curator/delete_index.yml --config /home/kristofferprojekt/.curator/curator.yml

What is root doing in there? Unless you have a different variant of cron (which is entirely possible), standard cron syntax does not have a user or group to execute as.

Also, if the path is not fully described, it may not pick it up. I would suggest using

48 09 * * * /path/to/curator /home/kristofferprojekt/.curator/delete_index.yml --config /home/kristofferprojekt/.curator/curator.yml

(system) #3

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