以下是我当前的 /etc/init.d/celeryd 脚本:
# Name of nodes to start, here we have a single node
#CELERYD_NODES="w1"
# or we could have three nodes:
CELERYD_NODES="w1 w2 w3"
# Where to chdir at start.
CELERYD_CHDIR="/srv/project/website"
# How to call "manage.py celeryd_multi"
CELERYD_MULTI="$CELERYD_CHDIR/manage.py celeryd_multi"
# How to call "manage.py celeryctl"
CELERYCTL="$CELERYD_CHDIR/manage.py celeryctl"
# Extra arguments to celeryd
CELERYD_OPTS="--time-limit=300 --concurrency=8"
# %n will be replaced with the nodename.
CELERYD_LOG_FILE="/srv/project/logs/celery/%n.log"
CELERYD_PID_FILE="/srv/project/celery/%n.pid"
# Workers should run as an unprivileged user.
CELERYD_USER="root"
CELERYD_GROUP="root"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="website.settings"
我现在想运行定期任务,添加/更改上面的示例如何为节拍模式创建脚本配置?
我是否只需将以下内容添加到文件中?最后一行是什么?
# Where the Django project is.
CELERYBEAT_CHDIR="/srv/project/website"
# Name of the projects settings module.
export DJANGO_SETTINGS_MODULE="website.settings"
# Path to celerybeat
CELERYBEAT="/opt/project/website/manage.py celerybeat"
# Extra arguments to celerybeat
CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"