Linux: nohup: Execute a command after exiting a shell
by Ali on Jun.20, 2009, under Linux
This is quite useful. I used to push jobs to the background and then exit shell, but it wasn’t an easy task considering I have short term memory issues (not a complete retard, just too much on my mind ;)). I found this awesome little command to have the commands or scripts run right after I’m off the wagon!
nohup
That’s it… simply run your comman with it:
nohup command
Don’t forget the ampersand at the end. Use absolute path for scripts:
nohup ~/script &
If your scripts requires additional options to run, use a quote right before the ampersand:
nohup ~/script "start" &
Note that you don’t need to use this for your wget command… wget comes with a built-in switch (b):
wget -b
Have fun!
To the extent possible under law, the creator has waived all copyright and related or neighboring rights to this work.
June 24th, 2009 on 7:24 AM
A much smarter way to do it would be to run things like this in screen. It allows you to just detach the screen and go back later and look at what it did.
September 2nd, 2009 on 11:30 AM
Screen and nohup are like apples and oranges in my opinion.