nohup
0---标准输入
1--标准输出
2---标准错误输出
test.py文件
print("111111111111111111")
print("222222222222222222")
with open("data/result/test.txt","w") as f:
f.write("hello")
f.write("\n")
nohup python test.py >data/result/test.log 2>&1 &
data/result/test.log文件
nohup: ignoring input
111111111111111111
222222222222222222
data/result/test.txt
hello
nohup python test.py >data/result/test.log 2>data/result/test.err &
data/result/test.log文件
111111111111111111
222222222222222222
data/result/test.err文件
nohup: ignoring input
data/result/test.txt
hello
nohup python test.py >data/result/test.log 2>/dev/null &
data/result/test.log文件
111111111111111111
222222222222222222
data/result/test.txt
hello
posted on 2019-10-09 10:31 happygril3 阅读(196) 评论(0) 收藏 举报
浙公网安备 33010602011771号