Wednesday, January 26, 2011

NOHUP:Running a process and log out

Nohup is a POSIX command to ignore the HUP (hangup) signal, enabling the command to keep running after the user who issues the command has logged out. The HUP (hangup) signal is by convention the way a terminal warns depending processes of logout.

nohup is most often used to run commands in the background as daemons. Output that would normally go to the terminal goes to a file called nohup.out if it has not already been redirected. This command is very helpful when there is a need to run numerous batch jobs which are inter-dependent.

If you redirect the streams you can avoid filling up your filesystem with nohup.out files as follow:


$ nohup tar czf /backup/home.tgz . > /dev/null 2>&1

No comments:

Post a Comment