diff --git a/README.rdoc b/README.rdoc index 171d56d..449635e 100644 --- a/README.rdoc +++ b/README.rdoc @@ -89,41 +89,6 @@ By mixing and matching the --load-file and --user opti If you want to override a variable (like your environment) at the time of deployment you can do so with the --set option: http://wiki.github.com/javan/whenever/setting-variables-on-the-fly -== Defining custom job types - -You can define custom job types in your schedule file: - - job_type :rails3_runner do |job| - job.command = "rails runner" - job.settings = { :use_bundler => true } - end - - every 1.day, :at => "2am" do - rails3_runner "MyModel.do_something_amazing" - end - -This would create a job like: cd /path/to/app && bundle exec rails runner "MyModel.do_something_amazing" - -By defining jobs like this, you can also make reusable system commands such as: - - job_type :my_great_command do |job| - job.command = "/usr/bin/my_great_command" - job.settings = { :environment => false, :path => false, :quote_task => false } - end - - every 3.days do - my_great_command "arg1 arg2 'arg3'" - end - -This would create a job like: /usr/bin/my_great_command arg1 arg2 'arg3' - -The settings available when creating job types include: - -environment:: Set to false to stop the command trying to specify the environment at all. Set to a string or symbol to set the environment to that. -path:: Set to false to stop the command running cd before the task. Set to a string or symbol to set the path the cd to. -use_bundler:: If set to true, the task will be prefixed by bundle exec -quote_task:: If set to false, whenever will not print the arguments passed to the job in quote marks - == Credit Whenever was created for use at Inkling (http://inklingmarkets.com) where I work. Their take on it: http://blog.inklingmarkets.com/2009/02/whenever-easy-way-to-do-cron-jobs-from.html