# Curator crontab not running

**URL:** <https://discuss.elastic.co/t/curator-crontab-not-running/141530>\
**Category:** Elasticsearch\
**Created:** [July 25, 2018, 9:03am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530 "2018-07-25T09:03:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![babydoll](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@babydoll](https://discuss.elastic.co/u/babydoll)\
**Post date:** [July 25, 2018, 9:03am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/1 "2018-07-25T09:03:04Z")

</div>

Hello. I'm running elasticsearch curator on Ubuntu. So my curator works:

`curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml`

and executing the curator creates a new index as I expected. I want to make this run every minute, so I executed crontab -e and added the following line:

`* * * * * xen curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml`

(xen is my username)

This doesn't work, therefore I tried restarting crontab using service cron restart and removing my username from the crontab -e file. Unfortunately it still doesn't work ☹

Here's the syslog line I got by running grep CRON /var/log/syslog:

```
Jul 25 08:17:01 ubuntu CRON[15144]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
Binary file /var/log/syslog matches

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![akhileshsingh](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@akhileshsingh](https://discuss.elastic.co/u/akhileshsingh)\
**Post date:** [July 25, 2018, 9:50am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/2 "2018-07-25T09:50:18Z")

</div>

@babydoll

Hope i can help you but i need some information.

1. Which python version you were using
2. Which environment you were using.

please use the below link also to resolve the crontab problem.  
[http://click.pocoo.org/5/python3/](http://click.pocoo.org/5/python3/)  
click will prematurely end promote execution since Python 3 was designed to utilize ASCII as encoding for nature.

This framework underpins the C.UTF-8 district which is prescribed.  
You may have the capacity to determine your issue by sending out the  
following condition factors:  
export LC\_ALL=C.UTF-8  
export LANG=C.UTF-8

And adding to crontab:

> LC\_ALL=C.UTF-8  
> LANG=C.UTF-8

Before the curator execution and after that restart cron service.  
hope the above step will help you.

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![babydoll](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@babydoll](https://discuss.elastic.co/u/babydoll)\
**Post date:** [July 26, 2018, 12:04am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/3 "2018-07-26T00:04:24Z")

</div>

Hello @akhileshsingh ! I'm using python 2.7.12 on Ubuntu!

---

<div class="post-metadata">

**Author:** ![akhileshsingh](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@akhileshsingh](https://discuss.elastic.co/u/akhileshsingh)\
**Post date:** [July 26, 2018, 8:16am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/4 "2018-07-26T08:16:16Z")

</div>

> [@babydoll](#):
>
> Hello @akhileshsingh ! I'm using python 2.7.12 on Ubuntu!

In order to further debug your issue, you need to perform below steps:  
`	1. Share the output for crontab -l command and the user used to set the crontab.`  
`2. After step-1, Set the below crontab entry. This will redirect the exact crontab error in /var/log/syslog with xensu as a tag. Share the logging with xensu tag for further investigation:`

```
* * * * * curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml 2>&1 | /usr/bin/logger -t xensu

```

`3. Also, please validate the file permissions for curator.yml and rollover.yml.`

Thanks

---

<div class="post-metadata">

**Author:** ![babydoll](https://avatars.discourse-cdn.com/v4/letter/b/f475e1/32.png) [@babydoll](https://discuss.elastic.co/u/babydoll)\
**Post date:** [July 26, 2018, 8:56am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/5 "2018-07-26T08:56:12Z")

</div>

@akhileshsingh

Thank you so much for your help! Here are the results:

1. 

```
crontab -l command output with user xen:
 # Edit this file to introduce tasks to be run by cron.
 # 
 # Each task to run has to be defined through a single line
 # indicating with different fields when the task will be run
 # and what command to run for the task
 # 
 # To define the time you can provide concrete values for
 # minute (m), hour (h), day of month (dom), month (mon),
 # and day of week (dow) or use '*' in these fields (for 'any').# 
 # Notice that tasks will be started based on the cron's system
 # daemon's notion of time and timezones.
 # 
 # Output of the crontab jobs (including errors) is sent through
 # email to the user the crontab file belongs to (unless redirected).
 # 
 # For example, you can run a backup of all your user accounts
 # at 5 a.m every week with:
 # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
 # 
 # For more information see the manual pages of crontab(5) and cron(8)
 # 
 # m h dom mon dow command
 * * * * * curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml 

```

2. Log output with xensu:  
Jul 26 17:34:01 ubuntu CRON[17739]: (xen) CMD (curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml 2\>&1 | /usr/bin/logger -t xensu)  
Jul 26 17:34:01 ubuntu xensu: /bin/sh: 1: curator: not found

1. File permissions:

Read and write for owner, group and others and execute allowed for both yml files

---

<div class="post-metadata">

**Author:** ![akhileshsingh](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@akhileshsingh](https://discuss.elastic.co/u/akhileshsingh)\
**Post date:** [July 26, 2018, 10:41am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/6 "2018-07-26T10:41:49Z")

</div>

@babydoll

I want to know how you have installed curator on your system either by using pip, source code or any other process.

> [@babydoll](#):
>
> curator: not found

It looks like that crontab is unable to find the binary of the curator.

So i request you to take output of the below commands and post it here for better understanding of your problem.

to find the binary of the curator run the below command.

> whereis curator

And use the output of the above command instead of curator and set the crontab entry.  
for example:

```
 * * * * * /usr/bin/curator --config /home/xen/curator/curator.yml /home/xen/curator/rollover.yml 2>&1 | /usr/bin/logger -t xensu

```

Thanks:)

---

<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:** [August 23, 2018, 10:42am UTC](https://discuss.elastic.co/t/curator-crontab-not-running/141530/7 "2018-08-23T10:42:27Z")

</div>

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