Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    37

    Unanswered: 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.

  2. #2
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320
    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.

  3. #3
    Join Date
    Feb 2004
    Posts
    37
    Thanks, It works..

    I appreciate your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •