I'm really new to linux (like earlier this week is when I started) so excuse me if this is a really simple question. I am running a program on a remote server and it's a lengthy process dealing with a couple hundred gb of data so I wanted to leave it running overnight. Long story short I ssh in, I start the program, watch to see that it's running and then close out of terminal. I come back this morning and see it stopped exactly where it was when I terminated my ssh the night before. Is there a way to keep the process running on the server when I close out?
Ssh – How to run a process overnight on a remote server after quitting out ssh
processremotessh
Best Answer
As the other answers suggest. You can use
nohup <command> &
.You can also use
screen
, this (basically) is a detachable terminal. You can start a terminal using the commandscreen
and when you want to detach from it. Ctrl+ad. And to reattach your terminal runscreen -r <terminal_name>
. If you have more then one detached terminal's, you can use the commandscreen -r
to see the names of the detached terminal's.EDIT:
You can also use
tmux
. Have a look here for a basic "how to usetmux
".