Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created April 3, 2012 20:14
Show Gist options
  • Save wrburgess/2295223 to your computer and use it in GitHub Desktop.
Save wrburgess/2295223 to your computer and use it in GitHub Desktop.
Setting up a cron job for heroku with Scheduler and Rake files #heroku #scheduler #cron #rake #rails #ruby

##References

##Create a Rake Command file at lib/tasks/scheduler.rake

desc "This task is called by the Heroku scheduler add-on"
task :method_name => :environment do

  puts "starting method_name process"

  #do something here  
  #do something here  
  #do something here

  puts "ending method_name process"

end

##Command line for heroku repo:

heroku addons:add scheduler:standard

##Go to Heroku Scheduler App for the relevant app:

##Submit this command to the Scheduler App:

rake method_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment