how to send ssh job to background

yasar picture yasar · Nov 18, 2011 · Viewed 11.1k times · Source

I logged in to a remote server via ssh and started a php script. Appereantly, it will take 17 hours to complete, is there a way to break the connection but the keep the script executing? I didn't make any output redirection, so I am seeing all the output.

Answer

Steve Rukuts picture Steve Rukuts · Nov 18, 2011

Can you stop the process right now? If so, launch screen, start the process and detach screen using ctrl-a then ctrl-d. Use screen -r to retrieve the session later.

This should be available in most distros, failing that, a package will definitely be available for you.