2

Hello I was trying to run a rake task every 5 minutes with this schedule code using the whenever gem

set :output, "#{path}/log/cron.log"

every 10.minutes do
  rake "delete:old_offers"
end

But the code never execute. If I try to run my task with:

rake delete:old_offers

everything works great, so the problem is in the schedule file. Please I need your help to solve this issues.

I'm planning to execute this task every 60 days in my heroku app, so I could the schedule has to work also on heroku.

Thanks in advance.


UPDATE

Sorry guys, I have to set the environment to development like this

set :environment, 'development'
Jean
  • 5,201
  • 11
  • 51
  • 87

1 Answers1

2

After you write your schedule, you need to actually update your crontab:

whenever --update-crontab

Simply running the whenever command by itself will only show you the schedule in cron format.

Dylan Markow
  • 123,080
  • 26
  • 284
  • 201
  • Dylan I did, but nothing happen. What else can I do??? How do I know if the task run, because this set :output, "#{path}/log/cron.log" it's never created – Jean Dec 20 '12 at 18:28