Alex Rivera | Logout

How do you deploy cron jobs to production?

Asked 2009-10-21T19:24:02.663
24

How do people deploy/version control cronjobs to production? I'm more curious about conventions/standards people use than any particular solution, but I happen to be using git for revision control, and the cronjob is running a python/django script.

Edit
Report

2 Answers

10

Using Fabric, I prefer to keep a pristine version of my crontab locally, that way I know exactly what is on production and can easily edit entries in addition to adding them.

The fabric script I use looks something like this (some code redacted e.g. taking care of backups):

def deploy_crontab():
    put('crontab', '/tmp/crontab')
    sudo('crontab < /tmp/crontab')
answered 2011-01-23T22:14:01.943
0

I use Buildout to manage my Django projects. With Buildout, I use z3c.recipe.usercrontab to install cron jobs in deploy or update.

answered 2011-05-06T03:45:25.590

Your Answer