GetFree GetFree - 29 days ago 8
Linux Question

Prevent a background process from being stopped after closing SSH client

I'm working on a linux machine through SSH (Putty).
I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.
To my surprise, that doesn't work. As soon as I close the Putty window, the process is stopped.

How can I prevent that from happening??

Answer

Check out the "nohup" program.