0

我打算让 cronjob 在 elasticsearch 上做 curator

0 17 * * * /usr/local/bin/curator_cli --host localhost delete indices --older-than 7 --time-unit days --timestring '\%Y.\%m.\%d' >> /var/log/curator.log 2>&1

它给我的日志错误

错误:没有这样的命令“删除”

错误:没有这样的选项:--older-than

什么命令应该替换 delete 和早于?

谢谢你。

4

1 回答 1

1

所以,然后我通过谷歌搜索找到了自己。我只是使用 yml 来完成任务。

0 17 * * * /usr/local/bin/curator /opt/action.yml >> /var/log/curator.log 2>&1

这是 action.yml:

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:
  logformat: default
  blacklist: ['elasticsearch', 'urllib3']
于 2018-02-28T04:52:50.880 回答