-   Linux - General (
-   -   problem with nohup command and nohup file size (

vbseeker 09-16-2006 09:07 AM

problem with nohup command and nohup file size

I am using rehl 4 server. Developed the bulk sms application.

In this i need to connect with 20 smsc. For connecting to each smsc i have created seperate java client programs.

Now if i am running this java appliation in the following way.

nohup java java1 & > java1.out
nohup java java2 & > java2.out
nohup java java3 & > java3.out
nohup java java4 & > java4.out
nohup java java5 & > java5.out
nohup java java6 & > java6.out
nohup java java7 & > java7.out
nohup java java8 & > java8.out
nohup java java9 & > java9.out
nohup java java10 & > java10.out

Now the problem i am facing is :

1. To check the status of the application i need tail the all the files one by one so see if the app is working well.
2. The nohup result file i.e. java1.out becomes too huge.
After 10 days i need to stop the application and delete the file and again run the command.

Can anybody help me to give a work around to do this work quickly.

Can anybody suggest any kind of utility that will help me to get rid off for the activity i am doing.


macemoneta 09-17-2006 12:36 PM

One suggestion is that instead of using nohup, use 'screen' and let the output go to stdout. Start each instance in a different screen session. You can then disconnect from screen. To check the status, just reconnect and you will have access to the most current output (100 lines in each session by default, but configurable).

For example (comments in parens):

screen -h 1000 (start screen with a scrollback of 1000 lines)
java java1 (start the first instance)
ctrl-a c (create a new session)
java java2 (start the second instance)
ctrl-a c (create a new session)
java java10 (start the last instance)
ctrl-a d (disconnect from screen)

Some time later:

screen -r (reconnect to the running screen sessions)
ctrl-a 0 (check the first instance)
ctrl-a 9 (check the last instance)
ctrl-a d (disconnect again)

All times are GMT -5. The time now is 08:46 AM.