nohup后台启动Python脚本,log不刷新的解决方法
2019-01-15 12:03
1891 查看
问题:
=》nohup python3 xxxx.py &后台启动脚本
tail -100f nohup.out --------> 无显示
原因:
python的输出有缓冲,导致日志文件并不能够马上看到输出。
-u参数,使得python不启用缓冲。
方法:
所以修改命令即可:
nohup python3 -u xxxx.py > nohup.out &
以上这篇nohup后台启动Python脚本,log不刷新的解决方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- 在cron启动定时任务后总是会启动一个[sendmail] 进程的解决方法, 并且每次cron任务之后msmtp.log总是记录一条发送失败的日志
- crontab 中 python 脚本执行失败的解决方法
- eclipse启动出现“An Error has Occurred. See the log file”解决方法
- jquery用get实现ajax在ie里面刷新不进入后台解决方法
- Golang Linux下面调用nohup启动程序无法返回问题,解决方法.
- Windows系统配置python脚本开机启动的方法
- python虚拟环境启动后依然使用全局pip的解决方法
- Python 3种启动方法: 交互式、python脚本、图形界面运行python
- Windows系统配置python脚本开机启动的3种方法分享
- 使用Python脚本实现批量网站存活检测遇到问题及解决方法
- ASP 点击控件刷新后页面样式发生变化后台实现解决方法
- eclipse启动出现“An Error has Occurred. See the log file”解决方法
- 从C调用Python脚本unableto load the file system codec ImportError错误解决方法
- 【python自动化运维】运行python脚本报错: /usr/bin/python3^M: bad interpreter: No such file or directory解决方法
- docker selenium环境运行python脚本时候,报错的解决方法
- python操作mysq-redis脚本及使用nohup或crontab任务后台执行
- python 启动提示IDLE's subprocess didn't make connection问题的解决方法
- eclipse启动出现“An Error has Occurred. See the log file”解决方法
- 后台动态添加控件后,脚本得不到控件的ID的解决方法
- 使用Python脚本实现批量网站存活检测遇到问题及解决方法