# Crontab and Elasticsearch-curator version 5.0.4

**URL:** <https://discuss.elastic.co/t/crontab-and-elasticsearch-curator-version-5-0-4/86939>\
**Category:** Elasticsearch\
**Created:** [May 24, 2017, 9:55am UTC](https://discuss.elastic.co/t/crontab-and-elasticsearch-curator-version-5-0-4/86939 "2017-05-24T09:55:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeci](https://avatars.discourse-cdn.com/v4/letter/y/c6cbf5/32.png) [@yeci](https://discuss.elastic.co/u/yeci)\
**Post date:** [May 24, 2017, 9:55am UTC](https://discuss.elastic.co/t/crontab-and-elasticsearch-curator-version-5-0-4/86939/1 "2017-05-24T09:55:39Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [May 24, 2017, 1:58pm UTC](https://discuss.elastic.co/t/crontab-and-elasticsearch-curator-version-5-0-4/86939/2 "2017-05-24T13:58:38Z")

</div>

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

```auto
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

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

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 21, 2017, 1:58pm UTC](https://discuss.elastic.co/t/crontab-and-elasticsearch-curator-version-5-0-4/86939/3 "2017-06-21T13:58:52Z")

</div>

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