SSH连接-运行程序-> ssh连接关闭时如何保持程序运行 [英] SSH connection - run program -> howto to keep program running when the ssh-connection is closed
问题描述
简而言之: 关闭远程服务器连接(关闭外壳窗口)时,保持perl/python/R/etc脚本/程序在服务器上运行(通过ssh连接)的最优雅的解决方案是什么?
In short: What is the most elegant solution to keep a perl/python/R/etc script/program running on a server (connected via ssh) when the remote server connection is closed (shell-window closed)?
详细信息: 我已经编写了一些脚本,这些脚本将在我们的服务器上运行几天.但是,在通过linux-shell通过SSH连接到服务器之后,启动程序并关闭窗口也会杀死程序-确定,那不是新的.但是,在关闭ssh连接之后,如何配置服务器以保持程序运行? 屏幕"可以是一种解决方案,嗯,但是对我来说,打字太多了,有时我忘记了启动屏幕会话并启动程序
In detail: I have written some scripts that will run several days on our server. However, after connecting to the server via SSH over a linux-shell, starting the program and closing the window will also kill the program - OK, thats not new. But, how must the Server be configured to keep the program running after the ssh-connection is closed? "screen" can be one solution, hmm but for me that to much typing and sometime I forgot to start a screen session and start the program
感谢您的建议!
干杯, 雪人
推荐答案
NOHUP - http://en.wikipedia.org/wiki/Nohup
ssh your_server
nohup nice perl your_script &
exit
这篇关于SSH连接-运行程序-> ssh连接关闭时如何保持程序运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!