我有一个运行的Java进程.如果我通过SSH启动进程并将命令传递给它工作正常,但如果我然后终止SSH会话,我将失去对该进程的"控制".我如何重新获得对该过程的"控制"?它还在运行.
我知道进程ID.这可能还是我必须重新开始这个过程?
你可能想要开始一个屏幕.
尝试screen在提示符下输入.(如果没有,请安装程序.)
示例运行:
$ ssh yourserver
Password:
$ screen # start the screen
$ java -jar YourApp.jar
output...
more output...
<Ctrl-A D> # detach process for later reattach
$ exit # exit your ssh session
Run Code Online (Sandbox Code Playgroud)
明天
$ ssh yourserver
Password:
$ screen -x # reattach process
$ java -jar YourApp.jar
output...
more output... # back to where we were yesterday.
Run Code Online (Sandbox Code Playgroud)
输入man screen以获取更多信息.
| 归档时间: |
|
| 查看次数: |
758 次 |
| 最近记录: |