0

我正在关注这篇文章。我想在注销 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 pts/5 Sl 0:02 /usr/bin/python3 -u /usr/lib/python3/dist-packages/spyderlib/widgets/externalshell/start_ipython_kernel.p

并且立即创建输出文件。这正常吗?我怎么知道程序等待指定时间运行?

4

1 回答 1

1

您的命令行会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"
于 2018-08-13T10:53:53.353 回答