1753774 Members
6951 Online
108799 Solutions
New Discussion юеВ

running as a process

 
Abra
Advisor

running as a process

I am trying to run a Jar program (Java) as a process, so that we can log off of the server and leave the program running.
Does anyone know if there is a way to do this through HPUX?
Unix Consultant
5 REPLIES 5
Jeff Schussele
Honored Contributor

Re: running as a process

Hi,

You need to prepend the command with nohup & append it with &

EX #nohup /path/to/java /path/to/file.jar &

This causes it to ignore hangups & quits & will run it in the background so that you get your prompt back.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Roger Baptiste
Honored Contributor

Re: running as a process

hi,

Run it in no Hangup mode and in the background :

nohup &

In addition, you can track the progress of the program by redirecting its output/error to a file as:

nohup >xyz.log 2>&1 &

That way, even after you logout, the program is running and you can check its status by checking xyz.log

HTH
raj
Take it easy.
Sachin Patel
Honored Contributor

Re: running as a process

Nice name A,

use & at the end of any programm and it will runs in backgroud.
use fg command and will bring any background program in forground.

#sleep 100 &

Sachin
Is photography a hobby or another way to spend $
MANOJ SRIVASTAVA
Honored Contributor

Re: running as a process

Hi A

Try running it from the cron ?



Manoj Srivastava
Abra
Advisor

Re: running as a process

Thank you all for your replys.

The nohup and & commands seemed to do the trick.

I greatly appreciate all of your help!
Unix Consultant