-   Linux - Software (
-   -   Run a program in the background??? (

KaptinKABOOM 07-05-2004 09:15 AM

Run a program in the background???
I am working with a cluster of computers running RedHat 7.3 (yeah I am going to upgrade the least the kernels on all the nodes).
This cluster is used to run simulations of molecular structires.

The Jobs on the cluster are run by way of a bash shell script. Currently the bash scripts are run from a terminal and that terminal is left open for the duration of the job (sometimes takes as long as 4 days!), AND id the terminal window is closed the job stops running....I guess What I am wondering is:

Is there a way to run a bash script in the background in a way that it dosent require a terminal to stay open? I know there has to be since multiple programs run as daemons in the background to do all kinds of jobs... I an just courious hotw to Give non-root users the ability to run these jobs. I just do not even know where to start searching for an answer.... any info would be very appricated!

idaho 07-05-2004 09:27 AM

You want to use the disown command.

You will find details in the bash man page. Specifically, look at the job control section.

KaptinKABOOM 07-05-2004 09:32 AM

Awsome, thanks for the quick reply! that seems to work perfectly I will integrate it into the bash scripts.... you rock!

jschiwal 07-06-2004 04:22 AM

You can also use the 'nohup' command. This command will allow you to log off, and produce a log file which by default is nohup.out. The command means 'no HUP'.

Cerbere 07-06-2004 06:44 AM

Or simply background the job by following the command with an ampersand, like so:

./ &

And now, during our limited-time, two-for-one special offer: The best place to start searching for an answer to your linux questions is here.

--- Cerbere

XavierP 07-06-2004 07:40 AM


Originally posted by Cerbere
The best place to start searching for an answer to your linux questions is ....
*cough* here *cough*


All times are GMT -5. The time now is 11:58 AM.