How to prevent a background process from being stopped after closing SSH client in Linux

GetFree picture GetFree · Nov 12, 2008 · Viewed 228.6k times · Source

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

JesperE picture JesperE · Nov 12, 2008

Check out the "nohup" program.