keep unix jobs running after logging off
February 12th, 2007 by Lawrence David
there are two ways to run a job after logging off a server.
let’s assume you’ve got a job named my_job.sh
(1) you can use nohup:
$ nohup my_job.sh &
(2) you can put the job into the background:
$ my_job.sh
[now, hit Cmd-Z]
$ bg
either way, when you log off, your jobs will keep running until completion.
Hi,
I also like to use the screen function. This way you get to keep any STDOUT or STDERR output that printed while you were away. You type ‘screen’ to get a new shell (sort of), then when you’ve done your command, you type Ctrl-A Ctrl-D to detach the screen. To go back to it, you type screen -r. You can do a bunch of screens at once.
I have no idea how to install things like this, but if you’ve got it on a computer, man screen will give lots of tricks.
BTW, I put a link to your site on our research group’s website (above). Great tips!!