Search code examples
pythondjangosupervisordcelerybeat

Django - User CeleryBeat in Production with Supervisor


An example celerybeat conf file looks like this

[program:celerybeat]
; Set full path to celery program if using virtualenv
command=celery beat -A myapp --schedule /var/lib/celery/beat.db --loglevel=INFO

; remove the -A myapp argument if you are not using an app instance

directory=/path/to/project
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/beat.log
stderr_logfile=/var/log/celery/beat.log
autostart=true
autorestart=true
startsecs=10

; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=999

How would I use celerybeat to schedule the CELERYBEAT_SCHEDULE = {} in my django settings file. What would I change --schedule /var/lib/celery/beat.db to? Thanks


Solution

  • If I understand the documentation well you have to write

    CELERYBEAT_SCHEDULE_FILENAME = '/var/lib/celery/beat.db'