Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django 需要0x时,Celeryd脚本打印输出2x_Django_Bash_Celery_Nohup - Fatal编程技术网

Django 需要0x时,Celeryd脚本打印输出2x

Django 需要0x时,Celeryd脚本打印输出2x,django,bash,celery,nohup,Django,Bash,Celery,Nohup,下面是我运行celeryd的小脚本: #!/bin/bash -x LOG=/home/var/log/ingest.log sudo -u apache bash -c "nohup `pwd`/bin/django celeryd --purge --beat --loglevel=INFO >> $LOG &" 我以普通用户的身份运行脚本,并在请求时输入root密码 我真的不希望看到任何输出-所有内容都发送到日志。相反,我看到的是每件事都翻了一番: [2012-03-

下面是我运行celeryd的小脚本:

#!/bin/bash -x
LOG=/home/var/log/ingest.log
sudo -u apache bash -c "nohup `pwd`/bin/django celeryd --purge --beat --loglevel=INFO >> $LOG &"
我以普通用户的身份运行脚本,并在请求时输入root密码

我真的不希望看到任何输出-所有内容都发送到日志。相反,我看到的是每件事都翻了一番:

[2012-03-19 19:54:38,987: INFO/PoolWorker-2] Received feed. 0 new entries out of 3 to process.
[2012-03-19 19:54:38,987: INFO/PoolWorker-2] Received feed. 0 new entries out of 3 to process.
[2012-03-19 19:54:38,988: INFO/MainProcess] Task atom_ingest.walk_feed[64d8e6c7-2ab4-4082-9d67-a8ecca9a4f7a] succeeded in 1.85489702225s: None
[2012-03-19 19:54:38,988: INFO/MainProcess] Task atom_ingest.walk_feed[64d8e6c7-2ab4-4082-9d67-a8ecca9a4f7a] succeeded in 1.85489702225s: None
[2012-03-19 19:55:32,083: INFO/Beat] Scheduler: Sending due task atom_ingest.walk_feeds
[2012-03-19 19:55:32,083: INFO/Beat] Scheduler: Sending due task atom_ingest.walk_feeds
[2012-03-19 19:55:32,285: INFO/MainProcess] Got task from broker: atom_ingest.walk_feeds[e65ddc54-23a5-46a0-86df-92479f79655b]
[2012-03-19 19:55:32,285: INFO/MainProcess] Got task from broker: atom_ingest.walk_feeds[e65ddc54-23a5-46a0-86df-92479f79655b]
这些输出都来自“后台”,这意味着当我做其他事情时,它会喷到我的终端上


我不确定我的错误是否在于我对bash、celeryd、nohup等的理解?

您可以告诉celeryd使用选项
-f
登录到一个文件

您仍将获得一些输出。celeryd似乎忽略了使用输出
2>&1>/your/file/
重定向的任何尝试

附言:我建议你研究一下如何管理你的流程