Blame view

runRequest 862 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
5a1df76c   Elena.Budnik   calcul in future
29
30
31
32
33
34
35
36
37
38
39
40
41
	for request in $REQ/$tgt*.xml
	do
		if [[ -f $request ]]
		 then
			if [ $src = "omni" ] 
			 then
				python run.py $tgt $request $SwStop & echo $!
			 else
				python run.py $tgt $request -1 & echo $!
			 fi
		else
				echo -100
		fi 
092572bf   Elena.Budnik   new args, intern...
42
43
	# run only first request !!!!
	exit
ea763814   Elena.Budnik   init
44
45
  done