如何在ubuntu

时间:2015-08-15 10:22:53

标签: ruby-on-rails ruby bash ruby-on-rails-3 cron

我使用when gem并在schedule.rb

中编写代码,在轨道上的ruby中创建一个cronjob
set :output, {:error => "log/cron_error_log.log", :standard => "log/cron_log.log"}
 every '* * * * * ' do
   command "puts 'you can use raw cron syntax too'"
 end

之后我用命令

更新我的crontab
whenever --update-crontab

并重新启动

sudo service cron restart

并按crontab -l

查看
  

每当生成任务时开始:/home/haseebahmad/projects/social/config/schedule.rb   * * * * * / bin / bash -l -c' put' \''您也可以使用原始cron语法' \'' >> log / cron_log.log 2>>登录/ cron_error_log.log'

     

每当生成任务时结束:/home/haseebahmad/projects/social/config/schedule.rb

但它没有工作意味着cronjo不起作用。我该怎么测试呢?

1 个答案:

答案 0 :(得分:0)

你可以运行你的cron工作, ruby / home / haseebahmad / projects / social / config / schedule