whenever icon indicating copy to clipboard operation
whenever copied to clipboard

crontab doesn't update after cap deploy

Open peddinti opened this issue 9 years ago • 10 comments

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?

peddinti avatar Jun 27 '15 05:06 peddinti

If you're using Capistrano 3 you put the require in your Capfile:

require 'whenever/capistrano'

https://github.com/javan/whenever#capistrano-v3-integration

benpickles avatar Jun 30 '15 09:06 benpickles

what do you mean by capfile? is it same as deploy.rb?

peddinti avatar Jul 01 '15 21:07 peddinti

You should have both, like so:

your_project
├── Capfile
└── config
    └── deploy.rb

benpickles avatar Jul 02 '15 08:07 benpickles

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.

mayatskiy avatar Jul 07 '15 16:07 mayatskiy

Did you have

set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }

in you deploy.rb?

joassouza avatar Jul 24 '15 23:07 joassouza

Maybe it would be easier to write to crontab the path with current symlink and not the real directory name?

madmike avatar Sep 06 '15 09:09 madmike

This failed for us using capistrano v3.4.0. Rolling back to cap v3.3.5 fixed the issue for us.

poblahblahblah avatar Oct 29 '15 23:10 poblahblahblah

Also having no luck with capistrano v3.4.0 and whenever 0.9.4

phillipsnick avatar Dec 09 '15 16:12 phillipsnick

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 avatar May 03 '16 13:05 lacco

@lacco Before you explicitly set :whenever_roles, did you have any servers in the :db role, which is the default?

benlangfeld avatar Jun 05 '16 19:06 benlangfeld