nohup.out


 
Thread Tools Search this Thread
Operating Systems AIX nohup.out
# 1  
Old 01-02-2007
nohup.out

I have a program which writes to nohup.out ...
over the time this nohup.out becomes a large file and i cannot read the contents of this file using a vi editor.... whe i do a vi nohup.out it gives an error insufficient memory....
do i need to clean this nohup.out periodically ( or compress it using tar and place it as an archived file) how to clean this nohup.out. or how to look into the contents of this nohup.out

Anybody who came across a similar problem pls respond.

thanks n Happy NEW YEAR.
Ram
# 2  
Old 01-04-2007
Quote:
Originally Posted by ramky79
I have a program which writes to nohup.out ...
over the time this nohup.out becomes a large file and i cannot read the contents of this file using a vi editor.... whe i do a vi nohup.out it gives an error insufficient memory....
do i need to clean this nohup.out periodically ( or compress it using tar and place it as an archived file) how to clean this nohup.out. or how to look into the contents of this nohup.out

Anybody who came across a similar problem pls respond.

thanks n Happy NEW YEAR.
Ram
The reason you cannot open the file with VI is the file is to large for VI to handle. You could look at the file using tail or more. The file is created by a background process running with nohup (No Hang Up) protection and the contents of the nohup.out is the output from the processes. First check the contents of the file and if safe just cat /dev/null to to clear it.
# 3  
Old 01-05-2007
thank you...
# 4  
Old 10-23-2007
nohup.out (file size)

Quote:
Originally Posted by johnf
The reason you cannot open the file with VI is the file is to large for VI to handle. You could look at the file using tail or more. The file is created by a background process running with nohup (No Hang Up) protection and the contents of the nohup.out is the output from the processes. First check the contents of the file and if safe just cat /dev/null to to clear it.
Hi..,
Related to this issue, is there a way to limit the size of nohup.out file automatically?

rgds,
Ollie
# 5  
Old 10-23-2007
Yes, there is: put a cron-job in effect, which truncates the file (by something like "cat /dev/null > nohup.out"). How often you will have to run this job depends on how much output your process generates.

But if you do not need the output of the job altogether (maybe its garbage anyways, only you can answer that) you could prevent writig to file nohup.out in first place. Right now you start the process in a way like this:

nohup command &

replace this by

nohup command 2>/dev/null 1>/dev/null &

and the file nohup.out won't even get created.

The reason why the output of the process is being directed to a file is:

Normally all processes (that is: commands you enter from commandline, there are exceptions, but they don't matter here) are attached to a terminal. Per default (this is how Unix is handling this) this is something which can display text and is connect to the host via a serial line. If you enter a command and switch off the terminal you entered it from the process gets terminated too - because it lost its terminal. Because in serial communication the technicians traditionally employed the words from telephone communication (where it came from) the termination of a communication was not called an "interruption" or "termination" but a "hangup". So programs got terminated on "hangups" and to program to prevent this was "nohup", the "no-termination-upon-hangup"-program.

But as it may well be that such an orphaned process has no terminal to write to it nohup uses the file nohup.out as a "screen-replacement", redirecting the output there, which would normally go to the screen. If a command has no output whatsoever though nohp.out won't get created.

bakunin
These 2 Users Gave Thanks to bakunin For This Post:
# 6  
Old 10-23-2007
Thanks for the reply..

Just noticed that it is an AIX forum, I hope the answer is valid in HPUX (and others) too..

Thanks Bakunin
Hope to see you on the Bridge table Smilie

BBO: OllieBond
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help with nohup

I have a script test1.ksh (Korn shell) and within that I am calling another script test2.ksh test2.ksh runs for a pretty long time and hence wanted to execute as nohup from within test1.ksh nohup ./test2.ksh Question 1) dont think the above is working , although executing the nohup... (1 Reply)
Discussion started by: alldbest
1 Replies

2. Shell Programming and Scripting

Saving nohup output to a file other than nohup.out

Shell : bash OS : Oracle Linux 6.4 I want to save the ouput of a nohup command to file other than nohup.out . Below are my 3 attempts. For both Attempt1 and Attempt2 , the redirection logs the output correctly to the output file. But I get the error "ignoring input and redirecting stderr to... (7 Replies)
Discussion started by: kraljic
7 Replies

3. UNIX for Dummies Questions & Answers

Nohup

Hi Every one , i wrote a script for nohpu ,which checks the service by using the port number and starts if it doesnt hear the port. It works good untill i colse the session. how to make it work even after closing the session .And aslo how to deamoize this script #!/bin/bash netstat -ptlen |... (2 Replies)
Discussion started by: vikatakavi
2 Replies

4. UNIX for Dummies Questions & Answers

nohup

Hi, We are trying to run a shell script using nohup command. But this scripts asks for user input (username and password). Once we enter credentials it should continue run in background. Can someone please suggest how can we implement this? we can't modify .sh file since they are provided by... (5 Replies)
Discussion started by: blak
5 Replies

5. UNIX for Dummies Questions & Answers

When we need nohup

Hi, I've read the man page on nohup. But I still can't see what's the differences if we just send a process to background versus sending a nohup process to background. eg: myprocess & vs nohup myprocess & Without nohup, myprocess would still run uninterruptible at background... (2 Replies)
Discussion started by: ehchn1
2 Replies

6. Shell Programming and Scripting

Problem with nohup

Hello I am running this script inst.sh #!/bin/ksh sqlplus -s username/password @temp.sql ----Here is my temp.sql set serveroutput on select instance_name from V$instance; exit When i run the script inst.sh on the command prompt...it runs fine...but when i run it using... (5 Replies)
Discussion started by: njafri
5 Replies

7. UNIX for Dummies Questions & Answers

nohup - help!

I find that if I use nohup (in bourne shell script) then all the interactive parts in my code are gone hidden... e.g., the places asking input from the user (such as ckyorn) will not be displayed. This is no good. Is there a way to use nohup (or similar utility) and meanwhile, to keep the... (9 Replies)
Discussion started by: bluemoon1
9 Replies

8. Solaris

NOHUP not working

Hello All, Here is a problem of NOHUP. I am trying to run a process which needs to be up and running even if the session is closed. I tried running it with "nohup", but starngely it is not working, when i exit from the session the process is also getting killed? plz help me in finding out... (4 Replies)
Discussion started by: shivamasam
4 Replies

9. UNIX for Advanced & Expert Users

Help on nohup

Hi I submitted a long running executable without using nohup. Now, is there any way I can assure to keep that process ON even if my session gets killed? Thanks Bobby (3 Replies)
Discussion started by: bobbyjohnz
3 Replies

10. UNIX for Dummies Questions & Answers

Nohup

Hi, Using nohup it sends output automatically to $HOME/nohup.out - how do I direct this output to another named file instead, so I can run several scripts in the background at once, directing their outputs into individual log files? Cheers (3 Replies)
Discussion started by: miwinter
3 Replies
Login or Register to Ask a Question