class Rufus::Scheduler
def schedule (cron_line, params={}, &block)
the job.
This method returns a job identifier which can be used to unschedule()
be used to unschedule the job.
Returns the job id attributed to this 'cron job', this id can
# outputs a message every weekday at 10pm
end
puts "it's break time..."
scheduler.schedule("0 22 * * 1-5") do
# will trigger s at 14:15 on the first of every month
scheduler.schedule("15 14 1 * *", s)
# five minutes after midnight
# will trigger the schedulable s every day
scheduler.schedule("5 0 * * *", s)
For example :
line, or http://www.google.com/search?q=man%205%20crontab).
following the Unix cron standard (see "man 5 crontab" in your command
Schedules a cron job, the 'cron_line' is a string
def schedule (cron_line, params={}, &block) params = prepare_params(params) # # is a job with the same id already scheduled ? cron_id = params[:cron_id] || params[:job_id] #@unschedule_queue << cron_id # # schedule b = to_block(params, &block) job = CronJob.new(self, cron_id, cron_line, params, &b) @schedule_queue << job job.job_id end