If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > scheduling jobs within a shell

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-29-04, 13:24
gomes009 gomes009 is offline
Registered User
 
Join Date: Feb 2004
Posts: 37
scheduling jobs within a shell

I have two Processes (Jobs) PROCESS A & PROCESS B.
PROCESS B is dependent on PROCESS A.
FOR A GIVEN RUN, I want to kick off PROCESS A 5 times (in a loop)
with a 300 seconds interval between each run.
For 1 PROCESS A run, I want to kick off 3 PORCESS B runs with a
60 seconds interval between each run.

Any help is appreciated.
Reply With Quote
  #2 (permalink)  
Old 03-01-04, 03:49
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
You can do something like that
Code:
A_count=5
A_interval=300
B_count=3
B_interval=60

acnt=0
while :
do
   acnt=`expr $acnt + 1` 
   echo "Run process A  $acnt/$A_count"

   bcnt=0
   while :
   do
      bcnt=`expr $bcnt + 1`
      echo "Run process B $bcnt/B_count"
      if [ $bcnt -lt $B_count" ]
         sleep $B_interval
      else
         break
      fi
   done

   if [ $acnt -lt A_count ]
      sleep $A_interval
   else
      break
   fi
done
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 03-01-04, 14:12
gomes009 gomes009 is offline
Registered User
 
Join Date: Feb 2004
Posts: 37
Thanks, It works..

I appreciate your help!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On