通过SSH启动长时间运行的程序 [英] Start a long-running program over SSH
问题描述
我有一个运行Ubuntu的虚拟机,并且可以通过SSH进入该虚拟机.我什至可以使用以下命令通过SSH启动我的python程序:
I have a Virtual Machine that is running Ubuntu, and I can SSH into the Virtual Machine just fine. I can even start my python program over SSH using the following:
python foldername/app.py
我在Windows计算机上,使用Git Bash进行SSH.如果我以此方式启动python程序,则必须将Git Bash窗口保持打开状态.如何启动python程序而不必在Windows机器上打开Git Bash?任何帮助深表感谢!
I am on a Windows machine, using Git Bash to SSH. If I start my python program this, way I have to leave the Git Bash window open. How can I start the python program without having to leave the Git Bash open on my Windows machine? Any help is much appreciated!
推荐答案
您可以使用 nohup
:
nohup python foldername/app.py &
现在您可以关闭连接,该程序将继续运行.您可以在此处找到更多信息.和此处.
now you can close your connection and the program will keep running. You can find more information here and here.
这篇关于通过SSH启动长时间运行的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!