Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 time 命令在远程服务器上运行 python 脚本,如下所示:
time python myscript.py
一段时间后服务器上发生SSH超时,所以我还需要用nohup运行它。所以,我有以下两个问题:
nohup time myscript.py &
请帮忙谢谢
nohup 通常会将 STDOUT 和 STDERR 写入当前目录中名为“nohup.out”的文件中。您将能够在该文件的末尾看到时间的输出。
解决这种输出重定向的另一种方法是:
nohup time bla.py >myoutput &
对 1.:是的
To 2.:您可以将输出重定向到文件
nohup time myscript.py > ~/time_output &