scheduling sequential tasks with whenever gem

i'm using whenever to schedule tasks for a rails application.

I have a task like:

every 24.hours do
   command "do_this"
   rake "do_that"
end

my point is, when i write it to my crontab, with whenever -w, i see that it generates two independent tasks running at the same time. the problem is, both are logically a sequence, that means, the rake task, "do_that", should run just if the command "do_this" did already, successfully run.

I tried to contact both like command "do_this" && rake "do_that" but i received a syntax error.

  • Does exist any trick to create this dependence between tasks in whenever?

  • Does the crontab execute the jobs at same time, in parallel or it process N tasks scheduled at the same time in a queue?

7
задан VP. 8 May 2011 в 16:24
поделиться