user1022241
user1022241

Reputation:

Using Screen to keep process running

So I have a domain and I need to keep a python process running after I exit my ssh session. Right now, when I exit, it goes poof.

I was told to use Screen, but am fighting with this gnu doc. How would I use Screen to run a python process, and keep it running after I exit my ssh session?

Upvotes: 0

Views: 1723

Answers (2)

Eduardo Ivanec
Eduardo Ivanec

Reputation: 11852

Although I love GNU Screen the classical solution for this is nohup, which is much more straightforward and equally useful if you don't ever need to reattach to the process.

nohup script.py should be enough. The process output gets saved to a file in the current directory.

Upvotes: 2

tkone
tkone

Reputation: 22728

Log on. Run screen. Launch your python program. Press crtl-a crtl-d to detach from your screen. Log out.

Log in again. screen -r to reattach to your process.

Upvotes: 8

Related Questions