whenever
whenever copied to clipboard
crontab doesn't update after cap deploy
Hi my application users capristone for deployement. But when i do a deploy the crontab doesnt get updated. However if i do whenever --update-crontab
it does get updated.
this is how my deploy.rb looks like
set :whenever_command, "bundle exec whenever"
require 'whenever/capistrano'
any idea why it is not working?
If you're using Capistrano 3 you put the require in your Capfile
:
require 'whenever/capistrano'
https://github.com/javan/whenever#capistrano-v3-integration
what do you mean by capfile? is it same as deploy.rb?
You should have both, like so:
your_project
├── Capfile
└── config
└── deploy.rb
I have the same problem. I use capistrano v3.4.0 and whenever v0.9.4 and rbenv. And I have
require 'whenever/capistrano'
in my Capfile. But crontab isn't updated after cap production deploy. And I see no whenever commands in my deploy log.
Did you have
set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
in you deploy.rb?
Maybe it would be easier to write to crontab the path with current
symlink and not the real directory name?
This failed for us using capistrano v3.4.0. Rolling back to cap v3.3.5 fixed the issue for us.
Also having no luck with capistrano v3.4.0 and whenever 0.9.4
It took some time for me to set this up, but I found out set you need to set whenever_roles
correctly depending on your environment:
set :whenever_roles, [:db, :mail, :tasks]
With this extra configuration, everything is working for me with capistrano v3.5.0 and whenever 0.9.4. For testing, you can also use
set :whenever_roles, :all
@lacco Before you explicitly set :whenever_roles
, did you have any servers in the :db
role, which is the default?