Project

auto_cron

0.0
No commit activity in last 3 years
No release in over 3 years
Generate a crontab
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.6.4
= 0.9.2
>= 0
 Project Readme

auto_cron¶ ↑

Powerful way to manage crontabs using capistrano.

Getting started¶ ↑

1) Add auto_cron to your Gemfile

2) In your capistrano deploy.rb file, add:

require “capistrano/auto_cron”

after “deploy:restart”, “auto_cron:publish”

3) If using ext/multistage: In deploy/production.rb, e.g. add:

set :auto_cron_templates, %w( publish production )

role :publish_crons, “cron-internal.example.com”

4) In config/auto_cron, add erb files corresponding to the files specified in step 3

e.g., config/auto_cron/publish.erb

# crons for production */5 * * * * cd /mnt/apps/mysite && bundle exec rake thinking_sphinx:index RAILS_ENV=<%= Rails.env %>

Advantages over other ruby cron managers¶ ↑

  • Uses crontab syntax, not a DSL that is going to get in your way

  • Uses ERB, everyone is familiar

  • Customize crons across environment

  • Crons are namespaced using application name specified in capistrano deploy file, so you can write crons for multiple apps to the same crontab without collision

Contributing to auto_cron¶ ↑

  • Contributions welcome, fork the project

Copyright © 2011 Alex Farrill. See LICENSE.txt for further details.