# Curator CRON problem

**URL:** <https://discuss.elastic.co/t/curator-cron-problem/140313>\
**Category:** Elasticsearch\
**Created:** [July 17, 2018, 11:14am UTC](https://discuss.elastic.co/t/curator-cron-problem/140313 "2018-07-17T11:14:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![frenkye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frenkye/32/33414_2.png) [@frenkye](https://discuss.elastic.co/u/frenkye)\
**Post date:** [July 17, 2018, 11:14am UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/1 "2018-07-17T11:14:30Z")

</div>

Hi,

I having problem with curator set as cron and last think I could think of is there is some check in the binary which don't allow it.

When I run it in shell it work OK, write into the /var/log/curator.log and does its job perfectly.

```
/opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml

```

But fun start with the crontab:

```
SHELL=/bin/bash
* * * * * /opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml

```

With this setup i says in syslog it START and END, but nothing really happen index are still open which should be deleted and nothing is logged:

```
Jul 17 13:11:01 elk-1 CRON[2260]: (root) CMD ([2262] /opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml)
Jul 17 13:11:01 elk-1 CRON[2260]: (root) END ([2262] /opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml)

```

Any ideas where might be the problem?

Versions / Config :

```
root@elk-1:~# curator --version
curator, version 5.5.4

root@elk-1:/etc/curator# cat config.yml
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
client:
  hosts:
    - 127.0.0.1
  port: 9200
  url_prefix:
  use_ssl: False
  certificate:
  client_cert:
  client_key:
  ssl_no_validate: False
  http_auth:
  timeout: 30
  master_only: False
logging:
  loglevel: INFO
  logfile: /var/log/curator.log
  logformat: default
  blacklist: ['elasticsearch', 'urllib3']

root@elk-1:/etc/curator# cat action.yml
# Remember, leave a key empty if there is no value. None will be a string,
# not a Python "NoneType"
#
# Also remember that all examples have 'disable_action' set to True. If you
# want to use this action as a template, be sure to set this to False after
# copying it.
actions:
  1:
    action: delete_indices
    description: >-
      Delete indices older than 14 days (based on index name), for filebeat- prefixed indices. Ignore the error if the filter does not result in an actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: filebeat-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 14
      exclude:
  2:
    action: delete_indices
    description: >-
      Delete indices older than 14 days (based on index name), for winsmtp- prefixed indices. Ignore the error if the filter does not result in an actionable list of indices (ignore_empty_list) and exit cleanly.
    options:
      ignore_empty_list: True
      timeout_override:
      continue_if_exception: False
      disable_action: False
    filters:
    - filtertype: pattern
      kind: prefix
      value: winsmtp-
      exclude:
    - filtertype: age
      source: name
      direction: older
      timestring: '%Y.%m.%d'
      unit: days
      unit_count: 14
      exclude:
```

---

<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 18, 2018, 6:56am UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/2 "2018-07-18T06:56:04Z")

</div>

Hi @frenkye

May i know which environment you were using so that i can help.

> [@frenkye](#):
>
> Jul 17 13:11:01 elk-1 CRON[2260]: (root) CMD ([2262] /opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml) Jul 17 13:11:01 elk-1 CRON[2260]: (root) END ([2262] /opt/elasticsearch-curator/curator /etc

Please share the log also after the above step.

Thanks.

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [July 18, 2018, 7:49am UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/3 "2018-07-18T07:49:58Z")

</div>

> [@frenkye](#):
>
> * * *

try  
\*/5 \* \* \* \*  
see the log

---

<div class="post-metadata">

**Author:** ![hdghg](https://avatars.discourse-cdn.com/v4/letter/h/3bc359/32.png) [@hdghg](https://discuss.elastic.co/u/hdghg)\
**Post date:** [July 24, 2018, 11:57am UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/4 "2018-07-24T11:57:10Z")

</div>

Hi,  
The answer is actually in help text, when you run script from the repo. It shows:

```auto
Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult http://click.pocoo.org/python3/for mitigation steps.

This system supports the C.UTF-8 locale which is recommended.
You might be able to resolve your issue by exporting the
following environment variables:

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8

```

And adding to crontab:

```auto
LC_ALL=C.UTF-8
LANG=C.UTF-8

```

before curator execution worked fine.

---

<div class="post-metadata">

**Author:** ![frenkye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frenkye/32/33414_2.png) [@frenkye](https://discuss.elastic.co/u/frenkye)\
**Post date:** [July 24, 2018, 1:31pm UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/5 "2018-07-24T13:31:17Z")

</div>

Hi,

sorry for late response.

> [@zqc0512](#):
>
> \*/5 \* \* \* \*

Don't want this to sound rude, but this doesn't help anything.

> [@akhileshsingh](#):
>
> May i know which environment you were using so that i can help.
> 
> ![](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frenkye/40/33414_1.png) frenkye:
> 
> > Jul 17 13:11:01 elk-1 CRON[2260]: (root) CMD ([2262] /opt/elasticsearch-curator/curator /etc/curator/action.yml --config /etc/curator/config.yml) Jul 17 13:11:01 elk-1 CRON[2260]: (root) END ([2262] /opt/elasticsearch-curator/curator /etc
> 
> Please share the log also after the above step.
> 
> Thanks.

I running Debian Stretch and there are not other lines in log for that cron.

```
Linux elk-1 4.9.0-7-amd64 #1 SMP Debian 4.9.110-1 (2018-07-05) x86_64 GNU/Linux

```

---

<div class="post-metadata">

**Author:** ![frenkye](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frenkye/32/33414_2.png) [@frenkye](https://discuss.elastic.co/u/frenkye)\
**Post date:** [July 24, 2018, 1:32pm UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/6 "2018-07-24T13:32:11Z")

</div>

> [@hdghg](#):
>
> And adding to crontab:
> 
> ```auto
> LC_ALL=C.UTF-8
> LANG=C.UTF-8
> 
> ```
> 
> before curator execution worked fine.

Thank you!!! Tried this just now and its working. But still don't know where you got the message, maybe it just because I run it under python 2.7.

---

<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 21, 2018, 1:32pm UTC](https://discuss.elastic.co/t/curator-cron-problem/140313/7 "2018-08-21T13:32:21Z")

</div>

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