Normally we log in a Linux machine using ssh. And when we logs out, those jobs started by the shell will get killed if they're not deamon or running at backend. [b]nohup[/b] is a useful tool to keep the job running at backend to prevent this "auto killed" behavior from happening.
Here's how to use it:
We'll see something printed out:
Meaning it's up. All the output info of [i]myjob[/i] will be kept in nohup.out of the current directory.
If we logout, [i]myjob[/i] will keep running at the backend.
To kill [i]myjob[/i], normally we use the command below to find out the pid, and use the [i]kill[/i] command to stop the process.
Here's how to use it:
# nohup myjob &
We'll see something printed out:
appending output to nohup.out
Meaning it's up. All the output info of [i]myjob[/i] will be kept in nohup.out of the current directory.
If we logout, [i]myjob[/i] will keep running at the backend.
To kill [i]myjob[/i], normally we use the command below to find out the pid, and use the [i]kill[/i] command to stop the process.
ps -A | grep myjob