Blame view

runRequest 777 Bytes
ea763814   Elena.Budnik   init
1
2
3
#!/bin/bash
# Prepare & Run Request

47081b7a   Elena.Budnik   work
4
5
6
7
tgt_vi=$1
src_vi=$2
TaoStop=$3
SwStop=$4
ea763814   Elena.Budnik   init
8
9
10

. $(dirname $BASH_SOURCE)/env.sh

47081b7a   Elena.Budnik   work
11
12
13
 IFS='_' read -r -a array <<< "$tgt_vi"
 tgt=${array[0]}
 
092572bf   Elena.Budnik   new args, intern...
14
15
16
 IFS='_' read -r -a array <<< "$src_vi"
 src=${array[0]}
 
ea763814   Elena.Budnik   init
17
 # delete results of previous calculations
f5a5ef6f   Elena.Budnik   work
18
 rm -rf $SW2NC/$tgt* $SW2DATA/$src/$tgt*
ea763814   Elena.Budnik   init
19
 
af920889   Elena.Budnik   ajust
20
 # delete previous requests 
f5a5ef6f   Elena.Budnik   work
21
 rm -f $REQ/*.xml 
ea763814   Elena.Budnik   init
22

47081b7a   Elena.Budnik   work
23
 cd $SW2ROOT/Bin.py; python makeRequest.py  $tgt_vi $src_vi $TaoStop $SwStop  > log
f5a5ef6f   Elena.Budnik   work
24
25
26
 DDLogin $DDUSER $DDPWD >> log
  
	
092572bf   Elena.Budnik   new args, intern...
27
 # run newly created Request - ONLY FIRST ONE !
47081b7a   Elena.Budnik   work
28
 # can be launched as stand alone executable
ea763814   Elena.Budnik   init
29
30
 for request in $REQ/$tgt*.xml
  do
2c651848   Elena.Budnik   if nothing to update
31
32
       if [[ -f $request ]]
       then
092572bf   Elena.Budnik   new args, intern...
33
		python run.py $tgt $request $SwStop & echo $!
2c651848   Elena.Budnik   if nothing to update
34
35
	else
	       echo -100
092572bf   Elena.Budnik   new args, intern...
36
37
38
	fi 
	# run only first request !!!!
	exit
ea763814   Elena.Budnik   init
39
40
  done