1833882 Members
1632 Online
110063 Solutions
New Discussion

nohup log messages

 
SOLVED
Go to solution
Hunki
Super Advisor

nohup log messages


We need to decrease the nohup logging , is there a way we can reduce the nohup logging for a certain process or stop the logging itself after a certain message has been logged in the nohup.out.

For example, stop the logging after message says "started" but want to have the process running even after stopping the logging in nohup.out. Can it be handled through a script.
Though I dont want to stop the logging altogether in nohup.out.
3 REPLIES 3
Sundar_7
Honored Contributor
Solution

Re: nohup log messages

nohup by default sends the STDOUT to nohup.out

If you want to stop the STDOUT and STDERR from being sent to nohup.out, then you will need to do this in the script that is generating the output !

You could try something like this



exec 1>/dev/null 2>/dev/null


Sundar.
Learn What to do ,How to do and more importantly When to do ?
Sandman!
Honored Contributor

Re: nohup log messages

You can reduce logging only by changing the application code so that it makes fewer print calls. If that is not possible then your only option is to stop logging to nohup.out once the desired string has appeared in the output file.

~cheers
Arturo Galbiati
Esteemed Contributor

Re: nohup log messages

Hi,
to avoid to write in nohup.out when you start the process define stdout and stderr:

nohup program 1>program.out 2>program.err
or
nohup program 1>program.log 2>&1

in this way to output in nohup.out

Rgds,
Art