On 6/22/09 6:32 PM, me wrote:

2009/6/23 Kamaraju S Kusumanchi<raju.mailingli...@gmail.com>

I have three programs - say proga, progb, progc.

proga, progb are completely independent. They take couple of hours to
finish. The time to complete proga, progb are not same.

progc should to be launched only after both proga, progb are finished.
progc
takes another couple of hours to finish.

What is good way to automate this problem (that is no manual interaction)?
I
prefer to use nohup since sometimes I have to log out of the machine before
the whole process finishes.

Currently I have a shell script that works as below.
1) launch proga, progb in the background using nohup.
2) Ask proga, progb to write a file when they finish.
3) Every five minutes check if these files are present. If they are
present,
launch progc.

This gets me going for now. But it looks terribly inefficient. I would
appreciate if someone can provide a better solution.

Using Debian Lenny (Stable).

thanks
raju
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact
listmas...@lists.debian.org



#!/bin/bash

prog1&
prog2&

while [ $(ps -A | grep -E 'prog1|prog2') == "0" ]
   do
     sleep 5
   done

prog3

Are progs a&b yours? If so, how about having each one check ps for the other one as part of it's exit. If the other one isn't running, start progc before exit.

Or if stuck with a script, start a&b; sleep an hour and a half; and then go into the 5 minute loop on ps | grep...

--
Glenn English
g...@slsware.com


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to