# Can't crontab curator

**URL:** <https://discuss.elastic.co/t/cant-crontab-curator/81819>\
**Category:** Elasticsearch\
**Created:** [April 10, 2017, 1:01pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819 "2017-04-10T13:01:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad\_Ramadan\_Abd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_ramadan_abd/32/36308_2.png) [@Mohammad\_Ramadan\_Abd](https://discuss.elastic.co/u/Mohammad_Ramadan_Abd)\
**Post date:** [April 10, 2017, 1:01pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/1 "2017-04-10T13:01:10Z")

</div>

Hi...  
I am installing my ELK and I need to rotate the logs in the server.  
now i have ELK 4.5, and to do this log rotation I've used the curator (3.4.1-1) which works very good but that's manual for example _sudo curator delete indices --older-than 365 --time-unit days --timestring '%Y.%m.%d'_  
I simply wanted to use it as crontab job as _45 16 \* \* \* sudo curator delete indices --older-than 365 --time-unit days --timestring '%Y.%m.%d'_  
for keeping my logs for single year only.  
the job didn't succeed knowing that am very new to Linux systems and am network guy not a developer.  
how to make this job automatic? why the crontab does't execute my curator command?  
TIA

---

<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:** [April 10, 2017, 4:22pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/2 "2017-04-10T16:22:55Z")

</div>

> [@Mohammad\_Ramadan\_Abd](#):
>
> ELK 4.5

What version? The Elastic Stack jumped from version 2.4 to 5.0.

I would bet that the issue is that you are running with `sudo`. You don't need `sudo` to run Curator. It only needs a client connection to Elasticsearch. It should never need to run as root.

Also, [Elasticsearch Curator version 5.0](https://www.elastic.co/guide/en/elasticsearch/client/curator/5.0/index.html) is out now, so 3.4 is more than a bit outdated.

---

<div class="post-metadata">

**Author:** ![USP\_rol](https://avatars.discourse-cdn.com/v4/letter/u/df788c/32.png) [@USP\_rol](https://discuss.elastic.co/u/USP_rol)\
**Post date:** [April 11, 2017, 8:10am UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/3 "2017-04-11T08:10:11Z")

</div>

In addition to Aarons answer, consider the following hints:

you wanna check if curator gets executed (then check the curator log) or if there is a problem executing the curator at all (maybe you know this already).

A usual error is not specifying the full path of a binary when using cron (cron is using a different `PATH` environment than your login session).  
make sure curator gets really executed by probably checking cron logs (on a RedHat based server in `/var/log/cron` and setting the correct full binary path of curator which you can find using `whereis curator`, again on a RedHat based RPM installation it would be `/usr/bin/curator`)

If you dont make any progress, the actual output of the cron-log error or more specifically the curator log would be helpful.

---

<div class="post-metadata">

**Author:** ![Mohammad\_Ramadan\_Abd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_ramadan_abd/32/36308_2.png) [@Mohammad\_Ramadan\_Abd](https://discuss.elastic.co/u/Mohammad_Ramadan_Abd)\
**Post date:** [April 12, 2017, 12:06pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/4 "2017-04-12T12:06:51Z")

</div>

Thank you so much for your reply.  
as I've already mentioned that i have a very short experience with the  
linux and the EL, plus an not a developer.  
Regarding the version of curator, thus what i got from my used documents  
and installation from the store.  
Unfortunately am not at office to have screenshot of the ELK version but it  
is 4.5.  
Upgrading the whole stack is considered but we still building and  
discovering things we need.  
Regarding the solution of my issue you suggest, i will try again without  
the sudo.  
Thank you so much for your help.

---

<div class="post-metadata">

**Author:** ![Mohammad\_Ramadan\_Abd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_ramadan_abd/32/36308_2.png) [@Mohammad\_Ramadan\_Abd](https://discuss.elastic.co/u/Mohammad_Ramadan_Abd)\
**Post date:** [April 12, 2017, 12:07pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/5 "2017-04-12T12:07:39Z")

</div>

Thank you so much for your help. I appreciate it.

---

<div class="post-metadata">

**Author:** ![Mohammad\_Ramadan\_Abd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_ramadan_abd/32/36308_2.png) [@Mohammad\_Ramadan\_Abd](https://discuss.elastic.co/u/Mohammad_Ramadan_Abd)\
**Post date:** [April 13, 2017, 2:17pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/6 "2017-04-13T14:17:39Z")

</div>

About the version, I checked again, was my mistake , it's ELK 4.4.2

---

<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:** [April 13, 2017, 4:27pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/7 "2017-04-13T16:27:57Z")

</div>

That must just be Kibana. There's no such thing as 'ELK' 4.4.2.

Kibana 4.x works with the Elasticsearch 2.x, and Logstash can work with almost any Elasticsearch.

We no longer refer to these as 'ELK', because there are more components, like Beats, and Monitoring, and the commercial plugins. The correct terminology is to name them individually, or collectively as the "Elastic Stack."

---

<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:** [May 11, 2017, 4:34pm UTC](https://discuss.elastic.co/t/cant-crontab-curator/81819/8 "2017-05-11T16:34:29Z")

</div>

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