欢迎访问服务器技术网-www.fuwuqijishu.com

解决”ignoring input and appending output to ‘nohup.out’”问题

运维 fuwuqijishu 2年前 (2022-09-04) 316次浏览 0个评论 扫描二维码

在编译执行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系统设置开机启动项的方法)。

喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

Warning: error_log(/www/wwwroot/fuwiqijishu/wp-content/plugins/spider-analyser/#log/log-0214.txt): failed to open stream: No such file or directory in /www/wwwroot/fuwiqijishu/wp-content/plugins/spider-analyser/spider.class.php on line 2900