使用CRON,每当宝石时,计划任务在AWS EC2中不起作用

时间:2018-02-21 02:16:18

标签: cron ruby-on-rails-5 whenever

我正在关注使用http://backup.github.io/backup/v4/

备份数据库的文章

我的schedule.rb看起来像这样:

every 1.day, :at => '2:00 am' do
  command "backup perform -t staging_backup"
end

我使用以下任务执行任务:

execute :bundle, :exec, "whenever --update-crontab"

当我检查crontab列表crontab -l时,它给了我

 # Begin Whenever generated tasks for: /home/deploy/apps/calltree_staging/releases/20180221015812/config/schedule.rb at: 2018-02-21 01:58:56 +0000
     0 2 * * * /bin/bash -l -c 'backup perform -t staging_backup'    
 # End Whenever generated tasks for: /home/deploy/apps/calltree_staging/releases/20180221015812/config/schedule.rb at: 2018-02-21 01:58:56 +0000

但调度不起作用,但是当我尝试手动运行时

backup perform -t staging_backup

立即执行备份

0 个答案:

没有答案