Curator CRON problem

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:

Hi @frenkye

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

Please share the log also after the above step.

Thanks.

try
*/5 * * * *
see the log

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

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:

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

before curator execution worked fine.

Hi,

sorry for late response.

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

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

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.

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