我正在关注使用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
立即执行备份