I'm connecting to a Linux machine through SSH, and I'm trying to run a heavy bash script that makes filesystem operations. It's expected to keep running for hours, but I cannot leave the SSH session open because of internet connections issues I have.
I doubt that running the script with the background operator, the ampersand (&), will do the trick, because I tried it and later found that process was not completed. How can I logout and keep the process running?
screengives you a lot more options, but if you are usingauthorized_keysto allow people to run a script remotely viassh, thenohupoption is a nice simple way for the script to start processes which last longer than thesshsession used to start them. – Mark Booth Sep 15 '11 at 10:33screenis dead.tmuxis king. Old hats prefernohup. – Cees Timmerman Jun 17 '15 at 15:02nohupis not needed in modern shells. – chicks Jun 22 '15 at 01:57