nohup query
I have a JBOSS server process which i am running it using nohup command({nohup ./run.sh}), & same out put is getting printed to Jboss server.log as well,As i dont want the two log files having the same log entries then i tried the command nohup ./run.sh > ../log/server.log
Using this format log entries in server.log are getting printed twice. Is there a better way by which i can redirect all output of nohup command to server.log without writing the same details twice to Jboss server log please please suggest |
You're dealing with two output channels, stdout and stderr. The system automatically opens three channels for you, stdin (the keyboard, channel 0), stdout (the monitor, channel 1) and stderr (the monitor, channel 2). You can redirect channel 1 and channel 2; i.e., when you
Code:
prog > file Code:
prog 2> /dev/null Code:
prog > file01 2> file02 Code:
prog > file 2>&1 If you just execute your program (without nohup) do you get double logs? If so, it might be a good idea to actually specify log files in the program -- open, write to, close -- to avoid duplication (or, maybe, tell JBoss to shut up, eh?). If that's not a problem, try the above and see what you get. Hope this helps some. |
All times are GMT -5. The time now is 03:15 AM. |