The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > AIX
Google UNIX.COM


AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
nohup - help! bluemoon1 UNIX for Dummies Questions & Answers 9 10-11-2007 08:49 PM
Help on nohup bobbyjohnz UNIX for Advanced & Expert Users 3 10-18-2006 08:56 AM
nohup ( no log message) mike1022 Shell Programming and Scripting 1 09-16-2006 05:55 PM
Nohup miwinter UNIX for Dummies Questions & Answers 3 07-21-2006 02:20 AM
nohup usage.. charan81 UNIX for Dummies Questions & Answers 2 05-21-2006 11:41 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-02-2007
Registered User
 

Join Date: Sep 2006
Posts: 42
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
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-04-2007
Registered User
 

Join Date: May 2006
Location: England
Posts: 256
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.
Reply With Quote
  #3 (permalink)  
Old 01-05-2007
Registered User
 

Join Date: Sep 2006
Posts: 42
thank you...
Reply With Quote
  #4 (permalink)  
Old 10-23-2007
Registered User
 

Join Date: Oct 2007
Posts: 2
nohup.out (file size)

Quote:
Originally Posted by johnf View Post
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
Reply With Quote
  #5 (permalink)  
Old 10-23-2007
Bughunter Extraordinaire
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,032
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
Reply With Quote
  #6 (permalink)  
Old 10-23-2007
Registered User
 

Join Date: Oct 2007
Posts: 2
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

BBO: OllieBond
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:34 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0