Skip to content

Instantly share code, notes, and snippets.

@jamesfwz
Forked from stevenyap/Whenever.md
Created June 17, 2014 09:16
Show Gist options
  • Select an option

  • Save jamesfwz/698c0334f6c187e84e1b to your computer and use it in GitHub Desktop.

Select an option

Save jamesfwz/698c0334f6c187e84e1b to your computer and use it in GitHub Desktop.

This gem makes creating cron jobs very easy!

  • Source: https://github.com/javan/whenever
  • After defining your crons, you need to run whenever -w to write out the crontab
  • Use crontab -l to see the list of cron jobs you have

Sample schedule.rb

set :output, {:standard => 'log/cron.log'} #logs to your log file to view

every 1.day, :at => '12:05 am' do
  runner "Notifier.run_send_reminder_emails(host: 'example.com')"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment