solaris nohup command -> knowledge article for the new oracle dba




you are a new oracle dba and you would like to run some unix shell scripts on your solaris server. you are going to log into the solaris server using tools like putty or reflexion or exceed. after logging in you will execute the shell script. however before the shell script finishes execution if you accidentally close your client tool then the shell script execution fails. In order to make the shell script execution finish even though your client connection accidentally closes, you can use the nohup unix command on the solaris server.

Below is the paragraph that explains about the nohup command.

Keep commands running after you leave with nohup

It’s 3 p.m., and you want to start a long job running. Unfortunately, you can’t be sure that the job will finish by 5 p.m. when you need to leave, and the company is very strict about making sure you log off when you leave. However, if you log off the system, the job will be stopped. What can you do?

On Solaris systems you can use the "nohup" (no hang-up) command to keep jobs running long after you log off the system. Using nohup tells the system not to "hang-up" on your job after you’ve logged off the system.

Here’s how to run the job, and keep it running after you log off:

root> nohup my-long-job &

make sure that there is a space between the filename and the & symbol and then press enter. the output will be saved automatically into the nohup.out file.

This creates a file named "nohup.out" in the current directory that contains the standard output of the command ("my-long-job") you’re running.
Everyone is happy because the job keeps running, you get to leave at 5 p.m., and you’re properly logged off the system

Author: admin