Duke-UNC Brain Imaging and Analysis Center
BIAC Forums | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password   Forgot your Password?
 All Forums
 Support Forums
 Unix Support
 Unix multiple terminals
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

wang
BIAC Alum

USA
57 Posts

Posted - Jul 03 2007 :  11:41:29 AM  Show Profile  Reply with Quote

It occurs to me several times recently that when I open multiple terminals in golgi, and run jobs in background, only the one which I currently work on will keep alive, all those terminals that I've set up jobs but did not touch for while will become decay (lose connections). This morning I had two jobs in kaze/data/GSK.01, they became disconnected again. Even I set up the jobs to work in background using "&", it seems the jobs stopped at around 10:13am anyway.This does not seem to be a connection problem because I can get access to it if I open a new terminal. Does anyone know how to keep multiple terminals alive? Thanks.

Lihong

petty
BIAC Staff

USA
453 Posts

Posted - Aug 28 2007 :  11:56:41 AM  Show Profile  Reply with Quote
this has nothing to do with keeping a terminal alive, but if you run your processes with "nohup" = no hang ups, they will run even if the terminal connection is lost.

ie: nohup ./NAMEofJOB > output.log &

this will run "NAMEofJOB" and will pipe anything that would be displayed in the terminal to "output.log", and it will run in the background

Edited by - petty on Aug 28 2007 1:24:24 PM
Go to Top of Page

syam.gadde
BIAC Staff

USA
421 Posts

Posted - Aug 28 2007 :  1:49:06 PM  Show Profile  Reply with Quote
Here's an additional trick:

./NAMEofJOB >& output.log &

The ">&" will redirect standard output and standard error to the file output.log. So if the program (or programs that it calls) produce error messages on standard error, they will go into output.log too. (This works for most shells, including bash and tcsh).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
BIAC Forums © 2000-2010 Brain Imaging and Analysis Center Go To Top Of Page
This page was generated in 0.52 seconds. Snitz Forums 2000