解决"ignoring input and appending output to ‘nohup.out’"问题
导读:在编译执行python文件的时候,采用nohup进行后台自动运行,但是在执行文件的时候出现"nohup: ignoring input and appending output to ‘nohup.out’"的错误提示。搜索文章之后将 解决...
在编译执行python文件的时候,采用nohup进行后台自动运行,但是在执行文件的时候出现"nohup: ignoring input and appending output to ‘nohup.out’"的错误提示。搜索文章之后将 解决办法记录下来。直接抛弃概念性的文件,直接将如何解决记录。
chmod +x hello.py
nohup python hello.py > /dev/null 2> & 1 &
这样将.py文件更换成我们自己的就可以了。这里仅仅是后台运行,但是我们如果希望确保重启和服务器变动之后也保持运行,则需要添加到开机启动项中(Debian/Ubuntu系统设置开机启动项的方法)。
声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!
若转载请注明出处: 解决"ignoring input and appending output to ‘nohup.out’"问题
本文地址: https://pptw.com/jishu/3924.html