Start Celery worker using a bash script

Create your file

# Create an empty file

# Make it executable
chmod +x

Add your worker details and project location:


# Activate your current python environment
source /environment/bin/activate

# Move to your current django project
cd /wwwroot/django-project/

CELERY_LOGFILE=/wwwroot/django-project/logs/celery_`date "+%Y-%m-%d.%H-%M-%S"`.log
CELERYD_OPTS=" --loglevel=INFO --autoscale=10,5 --concurrency=8"

celery worker -A project-name -f $CELERY_LOGFILE $CELERYD_OPTS &

Don't forget that you'll need to update this script and use your own root directory and project name.