我尝试使用Whenever和Capistrano在我的rails服务器上设置cron作业。
schedule.rb
every 1.minutes do
p "SUCCESS in every MINUTE"
runner "myObject.HELLO()"
end
来自本地目录$whenever --update
"SUCCESS in every MINUTE"
[write] crontab file updated
You have new mail in /var/mail/username
CapFile
require 'whenever/capistrano'
deploy.rb
set :whenever_command, "bundle exec whenever"
require "whenever/capistrano"
set :whenever_identifier, -> {"#{fetch(:appName)}_#{fetch(:production)}"}
这有用吗?如果不是我应该改变什么,我该如何测试呢?
Capistrano 3