5

I am trying to get Celery work for awhile now. All my crontabs works just fine when I test it synchronously

sudo celery -A testdjango worker --loglevel=DEBUG --beat

but when I do

celery multi start -A testdjango w1 -l info

none of my crontabs work. I am not sure why

Note: I tried other schedule intervals as well like with time delta The same thing happens with that as well.

So I am fairly certain this is not a crontab thing but somehow related to the way I am starting celery multi.

Also, the worker turns on just fine since I can see it in Celery Flower but no tasks get executed.

Jonathan
  • 2,728
  • 10
  • 43
  • 73
  • What does your log file look like? The problem is probably stored there. If you don't have one you can create the folder with "mkdir -p /var/log/celery" and then call celery multi start with the following parameter "--logfile=/var/log/celery/%n.pid" – bit2pixel Apr 28 '14 at 05:53

2 Answers2

6

So, the answer is pretty straightforward

Since periodic tasks need Beat just add --beat with the command.

something like this

celery multi start -A testdjango w1 --beat -l info
Jonathan
  • 2,728
  • 10
  • 43
  • 73
4

Alternatively instead of running Beat inside your worker process (which the docs for 3.1.18 say is not recommended) you can run it dedicated in the background with

celery beat -A testdjango --pidfile=/blah/beat.pid --detach

Be sure to save the pidfile somewhere so you can also kill the process later.

MrDBA
  • 420
  • 1
  • 6
  • 8