【问题标题】:Crontable not work when I set curl delete elasticsearch index当我设置 curl 删除弹性搜索索引时,Crontable 不起作用
【发布时间】:2020-12-14 18:01:53
【问题描述】:

我有脚本“delete_elk_index”,其中包括:

curl -XDELETE 'http://ip:9200/index0'

手动执行时可以,但是在crontab中设置时不起作用。

crontab 日志是:

MAIL (mailed 55 bytes of output but got status 0x004b from MTA#012)

我已经看到 [https://superuser.com/questions/1478754/crontab-job-log-message-shows-a-error-status-0x004b-from-mta012][1]

然后我更改我的 crontab :

 */1 *  *   *   *     /root/delete_elk_index.sh>/dev/null 2>&1

crontab 日志变成:

 CMD (/root/delete_elk_index.sh)

但是索引没有被删除。 如何在 crontab 中设置?

【问题讨论】:

    标签: elasticsearch curl cron


    【解决方案1】:

    编辑脚本如下:

    #!/bin/bash
    curl --request DELETE 'http://ip:9200/index0'
    

    也许您还需要像下面这样编辑 crontab:

     */1 *  *   *   *   root  /root/delete_elk_index.sh>/dev/null 2>&1
    

    【讨论】:

      猜你喜欢
      • 2015-05-23
      • 1970-01-01
      • 2016-01-30
      • 2014-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-11-30
      • 1970-01-01
      相关资源
      最近更新 更多