z3c.recipe.usercrontab ported to python 3¶
z3c.recipe.usercrontab is a simple buildout recipe to add content to your buildout user’s crontab.
Our django sites often have something like this in our buildout configs, just to give you an idea of what you can do with it:
[supervisor-cronjob]
# Start supervisor (which in turn starts django and celery)
# when the server starts.
recipe = z3c.recipe.usercrontab
times = @reboot
command = ${buildout:bin-directory}/supervisord
[django-session-cleanup-cronjob]
recipe = z3c.recipe.usercrontab
times = 14 3 * * *
command = ${buildout:bin-directory}/django clearsessions
Easy peasy. Especially starting the site @reboot is handy. You could also
add an entry in /etc/init.d/your_site, but this way most of the setup of
the site is handled for you by a single bin/buildout call.
The previous release was in 2010: it simply didn’t need any changes, it just performed the job it did and did it well :-) Now I’ve made a few small changes, mostly in the test code. Another package ported to python 3!