Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

nohup <command> & 1

Status
Not open for further replies.

Igaduma

Technical User
Nov 23, 2001
322
BE
Hi all,

I'm running as a normal user a script:
nohup <script> &

It doesn't seem to create a nohup.out in the directory I started it, which is strange.
How come it doens't generate it ?
It seems to output messages anyhow to my terminal, but killing the terminal & sessions leaves the script running, but I wonder where it's sending it's output ?
Is there a system wide nohup.out or am I causing serious havoc on the server ?

I tested it on a server for which I'm root and there it pipes output into nohup.out.

As usual, any help is appriciated :)


I
 
That does seem strange that nohup.out isn't being created.

If you are using nohup <command> & as a user other than root, perhaps you don't have write rights to the directory you are executing from?
 
I'm not sure why that's happening, but you could just do it explicitly by typing:

[tt]nohup script > nohup.out 2>&1 &[/tt]

What OS?

Annihilannic.
 
Hi there,
Sparc sol8 is the OS/arch

Yes, I should have write rights since I chmodd'ed 755 -R the whole directory tree and it's located in my homedir.

So I can try

nohup script > nohup.out

but what does the &quot;2>&1 &&quot; bit do ?

 
Try a find / -name 'nohup.out' -print

from your root directory, looking for the creation/access times. This should at least give you an indication as to whether the file is being created anywhere in the system, and possibly, why it's going there.
 
Hi Ken,

Yeah, tried that, even did a system-wide nohup.out search to no avail.

I bet the server must be sprinkled with holy water.
 
The 2>&1 & part is saying that both standard error and standard out will go to nohup.out. and the second & is the completion of the nohup <command> & line.
 
Ok, running it as this:

nohup script > nohup.out &

works purrrfectly :)

Thanks guys

I
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top