Crontab not cleared

364 views
Skip to first unread message

Claudio Poli

unread,
Dec 20, 2010, 6:35:13 PM12/20/10
to Whenever Gem
Hello,
I'm using whenever along with capistrano.

This is what I see:

* executing `whenever:clear_crontab'
* executing "cd /var/www/mysite/releases/20101220224932 && bundle
exec whenever --clear-crontab --load-file config/cron/production.rb"

[...]

* executing `whenever:update_crontab'
* executing "cd /var/www/mysite/current && bundle exec whenever --
update-crontab --load-file config/cron/production.rb"

The problem is that the --update-crontab appends data to my cron,
while --clear-crontab doesn't really clean it.

Any ideas? Thanks.

Javan Makhmali

unread,
Dec 21, 2010, 9:15:59 PM12/21/10
to whenev...@googlegroups.com
Does your deploy.rb set an application variable like `set :application, "my_app"`?

Javan

> --
> You received this message because you are subscribed to the Google
> Groups "Whenever Gem" group and because you're awesome.
> To post to this group, send email to whenev...@googlegroups.com
> To unsubscribe from this group, send email to
> whenever-gem...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/whenever-gem?hl=en

Claudio Poli

unread,
Dec 21, 2010, 9:21:31 PM12/21/10
to Whenever Gem
Hello,
yes it does.

We use capistrano multi staging, relevant bits:

# deploy.rb
require 'whenever/capistrano'
set(:application, "myapp")
# Whenever variables for capistrano recipe.
# The file to load is defined in respective stages.
set(:whenever_roles, :db)
set(:whenever_command, 'bundle exec whenever')

# deploy/production.rb
set(:whenever_identifier, "-f config/cron/production.rb")

Thanks.

Javan Makhmali

unread,
Dec 22, 2010, 2:26:14 PM12/22/10
to whenev...@googlegroups.com
I see the problem I think. Whenever needs a string to identify each set of cron jobs with and with your use of "-f config/cron/production.rb" leaves that string blank and just sets the file to load.

Maybe do something like this in each stage's file.

#deploy/production.rb
set(:whenever_identifier, "#{application}_production -f config/cron/production.rb")


Javan

sidco...@gmail.com

unread,
Jul 15, 2016, 1:21:50 PM7/15/16
to Whenever Gem, maste...@gmail.com
Did Javan's reply solve your problem?
Reply all
Reply to author
Forward
0 new messages