2

I have my Ubuntu server setup so my Django project will bestarted by upstart like this:

#!/bin/bash
  set -e
  LOGFILE=/var/log/gunicorn/foo.log
  LOGDIR=$(dirname $LOGFILE)
  NUM_WORKERS=3
  # user/group to run as
  USER=django
  GROUP=django
  cd /var/www/webapps/foo
  source ../env/bin/activate
  test -d $LOGDIR || mkdir -p $LOGDIR
  exec ../env/bin/gunicorn_django -w $NUM_WORKERS \
    --user=$USER --group=$GROUP --log-level=debug \
    --log-file=$LOGFILE 2>>$LOGFILE && celeryd -l info -B

As you can see I also added celeryd at the end. But its not started Im sure it does not start as my tasks is not getting done. When I start it in the terminal on the server with:

manage.py celeryd -l info -B it does start and I can see the tasks being done.

How am I supposed to start it with Django?

dgel
  • 16,352
  • 8
  • 58
  • 75
Harry
  • 13,091
  • 29
  • 107
  • 167

1 Answers1

1

You should create a separate upstart script for starting celeryd. This should get you started.

Community
  • 1
  • 1
dgel
  • 16,352
  • 8
  • 58
  • 75
  • hey please can anyone help me that i want to start the periodic task schedule at `10PM` today and this schedule of repeat at the interval of 60 seconds. then what should i do?? – Rohitashv Singhal Aug 28 '12 at 10:48