[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: OT: launching jobs in a combined serial parallel way



Hi,


I didn't test that script, just writing it from memory, but maybe that gives you some ideas:

#!/bin/bash

prog1 &
prog2 &

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

prog3


more or less like that


greetings,
vitaminx


2009/6/23 Kamaraju S Kusumanchi <raju.mailinglists@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-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org




--
www ... http://www.callistix.net/
mail ... vitaminx@callistix.net
irc ... #chezpaeule @ euirc
mud ... vitaminx @ aardmud

Reply to: