shangwei
nohup python xxx.py > nohup.log 2>&1 &

程序将于后台运行。

nohup /opt/work/web/xenwebsite/xenwebsite-env/bin/python2.7 > nohup.log 2>&1 runserver.py &

nohup : 后台运行
/opt/work/web/xenwebsite/xenwebsite-env/bin/python2.7 : python环境
> nohup.log 2>&1 : 错误日志写入 nohup.log
runserver.py & : 运行runserver.py 文件

运行成功他会返回进程id  可以根据进程id关掉这个文件
ps -ef | grep 进程id : 查找这个进程
kill -9 进程id : 杀掉这个进程

 

分类:

技术点:

相关文章: