Changeset 7256 for trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
- Timestamp:
- 08/03/05 20:45:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
r7233 r7256 33 33 34 34 callistorcnew=$setuppath/callisto/callisto.rc 35 callistorcmarapr05=$setuppath/callisto/callisto_MarApr05.rc 35 36 36 37 table=SequenceProcessStatus … … 39 40 datetime=`date +%F-%H-%M-%S` 40 41 year=`date +%Y` 41 pno=500 # number of processes, i.e. number of todo-files42 #pno=500 # number of processes, i.e. number of todo-files 42 43 43 44 todofile=$listpath/ToDo-$table-$column … … 72 73 echo " -> choose one file and start calibrating" >> $scriptlog 2>&1 73 74 else 74 # echo "run checkfilesforsequenceavail" >> $scriptlog 2>&175 # $scriptspath/checkfilesforsequenceavail76 77 75 echo "getting list..." >> $scriptlog 2>&1 78 76 check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'` … … 82 80 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 83 81 esac 84 echo "cutting to-do-file" >> $scriptlog 2>&185 echo "getting no of lines" >> $scriptlog 2>&186 lines=`cat $todofile.txt | wc -l`87 echo "number of lines: "$lines >> $scriptlog 2>&188 while (( "$lines" < "$pno" ))89 do90 echo "# of lines ($lines) < # of processes ($pno) "91 pno=`expr $pno / 2`92 done93 echo "pno: "$pno94 nofiles=`expr $lines / \( $pno - 1 \)`95 nofiles=`expr $nofiles + 1 `96 echo "number of files: "$nofiles >> $scriptlog 2>&197 echo "deviding todo-file" >> $scriptlog 2>&198 for (( j=1 ; j <= $pno ; j++ ))99 do100 begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)101 end=$(echo "$begin + $nofiles - 1" | bc -l)102 echo "begin: "$begin >> $scriptlog 2>&1103 echo "end: "$end >> $scriptlog 2>&1104 file=${todofile}-${j}.txt105 echo "file: "$file >> $scriptlog 2>&1106 sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt107 done108 109 rm -v $todofile.txt >> $scriptlog 2>&1110 82 fi 111 83 … … 114 86 nr=bla 115 87 echo "finding the right todo-file" >> $scriptlog 2>&1 116 for (( i = 1; i <= $pno ; i++ )) 88 todofiles=`ls $listpath/ToDo-$table-$column-*` 89 90 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1 91 92 for todofile in ${todofiles[@]} 117 93 do 118 if ! ls $todofile -$i.txt>> $scriptlog 2>&194 if ! ls $todofile >> $scriptlog 2>&1 119 95 then 120 96 echo "file is not on disk -> continue" >> $scriptlog 2>&1 121 97 continue 122 98 fi 123 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 99 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 100 date > $lockfile >> $scriptlog 2>&1 124 101 checklock=$? 125 102 case $checklock in … … 139 116 esac 140 117 141 142 sequences=(`cat $todofile-$nr.txt`) 118 sequences=(`cat $todofile`) 143 119 144 120 if [ "$sequences" = "" ] 145 121 then 146 122 echo "nothing to do -> exit" >> $scriptlog 2>&1 147 rm -v $todofile -$nr.txt>> $scriptlog 2>&1148 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1123 rm -v $todofile >> $scriptlog 2>&1 124 rm -v $lockfile >> $scriptlog 2>&1 149 125 date >> $scriptlog 2>&1 150 126 exit … … 170 146 else 171 147 echo "no callisto.rc found in $outpath -> making link " >> $scriptlog 2>&1 172 ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1 148 if [ 49735 -lt $sequence ] && [ $sequence -lt 53516 ] 149 then 150 ln -vs $callistorcmarapr05 $outpath/callisto.rc >> $scriptlog 2>&1 151 else 152 ln -vs $callistorcnew $outpath/callisto.rc >> $scriptlog 2>&1 153 fi 173 154 callistorcseq=$outpath/callisto.rc 174 155 fi … … 258 239 done 259 240 260 rm -v $todofile -$nr.txt>> $scriptlog 2>&1261 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1241 rm -v $todofile >> $scriptlog 2>&1 242 rm -v $lockfile >> $scriptlog 2>&1 262 243 263 244 set +C
Note:
See TracChangeset
for help on using the changeset viewer.