问题描述
我正在使用某些EC2实例来运行一些无法在本地运行的大型作业。我看到的问题是,一段时间(自过程开始以来的X个小时),我在shell上的连接使我出现了管道破裂的错误
I am using some EC2 instances to run some large jobs I can not run locally. The issue I am seeing is that after a while (X hours since the process started) my connection on my shell gives me a broken pipe error
ubuntu@ip-10-122-xxx-xxx:~/stratto/ode$ Write failed: Broken pipe
该实例仍然存在,因为我可以毫无问题地重新连接,但是如何重新连接并重新获得与断管之前一样的进程日志
The instance is still there because I can reconnect with no problems, but how can I reconnect and get back at seeing the logs of the process as before the 'Broken Pipe'
任何提示,
,谢谢!
Any tip much appreciated,Thanks!
推荐答案
将输出重定向到文件,然后运行程序 nohup ...以确保断开连接不会杀死它。使用 tail -f监视重定向的文件。
Redirect your output to a file and then run the program "nohup ..." to ensure the disconnect doesn't kill it. Use "tail -f" to monitor the redirected file.
注意:最初说是使用 tee,但是不起作用。我认为直接重定向然后在文件上尾巴是可行的。
Note: Originally said to use "tee" but that won't work. I think a straight redirect and then tail on the file works.
这篇关于当我在ssh上收到“ Broken Pipe”错误时,EC2实例中的进程会如何处理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!