我正在关注这个帖子。我想在退出 ssh 后在后台运行 python 脚本,而不将输出存储到特定文件中。即,我希望使用以下 bash 命令:
nohup python3 main.py --dataset CorrSR/testTraining/small --train --input_height=256 --output_height=256 --epoch=2 | at 1:25 PM Mon > logs/background_run_small.txt &
我不确定命令的顺序。是|
之前>
?该命令运行时没有错误,但立即打开了一个进程
4285 分/5 SL 0:02/usr/bin/python3-u/usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/start_ipython_kernel.p
并且立即创建输出文件。这是正常的吗?我怎么知道程序等待指定的时间运行?
您的命令行会main.py
立即执行。
你可能想要的是:
echo 'nohup python3 main.py --dataset CorrSR/testTraining/small --train --input_height=256 --output_height=256 --epoch=2 > logs/background_run_small.txt' | at "1:25 PM Mon"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句