I'm ssh
ing into a server and I'm starting a Python script that'll take approx. 24 hours to complete. What if my internet connection dies in the middle? Will that stop the command?
Is there any way to run my long-running command in a way that local disconnects won't affect it and I could continue to see its output after I log in to ssh
again?
Answer
The best way is to use screen
(on the server) to start a session to run the command in and then disconnect the screen so it will keep running, and you can do other things, or just disconnect from the server. The other option is to use nohup
in combination with &
so you would have nohup
No comments:
Post a Comment