【发布时间】:2018-02-21 08:25:12
【问题描述】:
我正在使用 Rails 5 的每当 gem。我正在尝试解决问题,在 config/schedule.rb 创建默认 schedule.rb 文件后,我添加了一些日志记录指令
# Learn more: http://github.com/javan/whenever
set :environment, "development"
every 10.minutes do
rake "events:calc_index", :output => {:error => 'error.log', :standard => 'cron.log'}
end
我重新启动了我的 Rails 服务器(不确定这是否重要),但我没有在任何地方看到这些日志文件。我已通过运行“crontab -e”并查看作业来验证我的 crontab 是否已设置
0,10,20,30,40,50 * * * * /bin/bash -l -c 'cd /Users/davea/Documents/workspace/newproj && RAILS_ENV=development bundle exec rake events:calc_index '
日志文件在哪里创建?
【问题讨论】:
标签: ruby cron ruby-on-rails-5 whenever logfile