3

I'm trying to get whenever to work with sinatra. When I run the whenever command, I get the generated cron tab. But the problem is, that in my sinatra app, I don't have a script/runner file, which is present in Rails.

How do I get this runner, or is there a whenever command to generate one?

thx!

23tux
  • 14,104
  • 15
  • 88
  • 187

1 Answers1

3

You can use a rake task in place of script/runner. The Whenever gem supports defining the job via a rake task (and more in fact)

Sample: # config/schedule.rb

every 3.hours do
  rake "destroy_all"
end

and in your Rakefile: (for lack of good examples)

task :destroy_all do
  puts "Do not do this"
  # sh "rm -rf ."
end
Kashyap
  • 4,696
  • 24
  • 26