【问题标题】:Cron task for Rails application (elasticsearch)Rails 应用程序的 Cron 任务 (elasticsearch)
【发布时间】:2015-06-27 03:40:58
【问题描述】:

如果 gem elasticsearch 没有在我的 Rails 应用程序中运行,我想启动它。我不想使用任何其他宝石来做到这一点。 所以我创建了文件 start.sh:

if pgrep -u sth java; then
   /home/sth/sth/attractions/elasticsearch-1.6.0/bin/elasticsearch
fi

我把它放在了 crontab 中:

* * * * * /home/sth/sth/attractions/start.sh

脚本不工作,我不知道为什么。

【问题讨论】:

    标签: ruby-on-rails elasticsearch cron crontab


    【解决方案1】:

    Cron 不是在 Linux 下执行此操作的方法,init 系统可以在这里为您提供帮助:

    https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-service.html

    【讨论】:

      猜你喜欢
      • 2012-04-06
      • 2021-05-13
      • 1970-01-01
      • 1970-01-01
      • 2011-12-03
      • 1970-01-01
      • 2015-10-10
      • 1970-01-01
      • 2014-11-30
      相关资源
      最近更新 更多