Skip to content

Instantly share code, notes, and snippets.

@alexanderjulo
Created June 29, 2012 15:16
Show Gist options
  • Save alexanderjulo/3018527 to your computer and use it in GitHub Desktop.
Save alexanderjulo/3018527 to your computer and use it in GitHub Desktop.
celery crontab example
from celery.schedules import crontab
from flask.ext.celery import Celery
CELERYBEAT_SCHEDULE = {
# executes every night at 4:15
'every-night': {
'task': 'user.checkaccounts',
'schedule': crontab(hour=4, minute=20)
}
}
celery = Celery(www)
@celery.task(name='user.checkaccounts')
def checkaccounts():
# do something
pass
@Allan-Nava
Copy link

How can I start the celery process with a crontab on server reboot?

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