# How do I use this curator-cli in crontab?

**URL:** <https://discuss.elastic.co/t/how-do-i-use-this-curator-cli-in-crontab/119282>\
**Category:** Elasticsearch\
**Created:** [February 9, 2018, 5:31pm UTC](https://discuss.elastic.co/t/how-do-i-use-this-curator-cli-in-crontab/119282 "2018-02-09T17:31:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omid](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/omid/32/33595_2.png) [@omid](https://discuss.elastic.co/u/omid)\
**Post date:** [February 9, 2018, 5:31pm UTC](https://discuss.elastic.co/t/how-do-i-use-this-curator-cli-in-crontab/119282/1 "2018-02-09T17:31:58Z")

</div>

I used this to **erase daily indexes**

`curator_cli --host 127.0.0.1 --timeout 300 --port 9200 --http_auth elastic:changeme delete_indices --filter_list '[{"filtertype":"age", "source":"name", "direction":"older", "unit":"days", "unit_count":1, "timestring":"%Y.%m.%d"}]'`

But how do I put it inside the **crontab**?  
Please advise

---

<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:** [February 10, 2018, 12:28am UTC](https://discuss.elastic.co/t/how-do-i-use-this-curator-cli-in-crontab/119282/2 "2018-02-10T00:28:25Z")

</div>

If you're using crontab, I would recommend using the regular `curator` command with a proper YAML configuration file, so that the command will be something more like

```auto
curator /path/to/action.yml

```

as opposed to what you're doing with the long `curator-cli` line.

As for how to use cron and crontab, I would suggest [this howto document](https://help.ubuntu.com/community/CronHowto).

---

<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:** [March 10, 2018, 12:28am UTC](https://discuss.elastic.co/t/how-do-i-use-this-curator-cli-in-crontab/119282/3 "2018-03-10T00:28:35Z")

</div>

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