Monday, October 25, 2010

Prevent termination of shell command executing during logoff

Use Case

You've started a process that will take a long time, and didn't specify nohup in front of it, and don't want your command to be terminated on logoff.

Solution

Press Ctrl + Z - this will suspend the job
Enter disown -h %xxx, where xxx is the job number you get after suspending the job
Execute bg to put the job in the background
Disconnect from the shell

More information about bash commands can be found here: http://linux.about.com/library/cmd/blcmdl1_disown.htm

No comments:

Post a Comment