Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where will be nohup file created/stored

Tags:

linux

shell

On executing below given command within a script file:

Command :

nohup /usr/hp/ism/jboss-3.2.8.SP1/bin/run.sh &

Where will the nohup.out file be created, assuming that script is running in root directory ?

like image 682
Srijan Chaudhary Avatar asked Dec 07 '16 10:12

Srijan Chaudhary


2 Answers

Could you check home directory.

also you can redirect as below;

nohup /usr/hp/ism/jboss-3.2.8.SP1/bin/run.sh &> /tmp/nohup.out

man nohup ;

If standard input is a terminal, redirect it from /dev/null. If standard output is a terminal, append output to 'nohup.out' if possible, '$HOME/nohup.out' otherwise. If standard error is a terminal, redirect it to standard output. To save output to FILE, use 'nohup COMMAND > FILE'.

like image 116
Mustafa DOGRU Avatar answered Oct 08 '22 02:10

Mustafa DOGRU


Running a python code using nohup and & the nohub.out was in the same directory as the command was run from

pwd output:

/home/dv/project7

command run:

nohup python3 /home/dv/project7/test_code_v3.1.py &

ls -l output:

test_code_v3.1.py
nohup.out

I think a better way is so that your program outputs to your own error log file vs. stdout thgerefore to nohub.out

like image 34
FastGTR Avatar answered Oct 08 '22 00:10

FastGTR