Feed on

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.

Bookmark and Share

if that was helpful ...

check out the other tips and tricks i've compiled on these pages. you might learn something else interesting!

One Response to “keep unix jobs running after logging off”

  1. on 11 Dec 2007 at 10:25 pm Ilana


    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!!

Did I get this wrong? Let me know!

Trackback URI | Comments RSS