Changeset 7256 for trunk/MagicSoft/Mars/datacenter/scripts/runstar
- Timestamp:
- 08/03/05 20:45:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/runstar
r7233 r7256 37 37 datetime=`date +%F-%H-%M-%S` 38 38 year=`date +%Y` 39 pno=500 # number of processes, i.e. number of todo-files39 #pno=500 # number of processes, i.e. number of todo-files 40 40 41 41 todofile=$listpath/ToDo-$table-$column … … 77 77 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 78 78 esac 79 echo "cutting to-do-file" >> $scriptlog 2>&180 echo "getting no of lines" >> $scriptlog 2>&181 lines=`cat $todofile.txt | wc -l`82 echo "number of lines: "$lines >> $scriptlog 2>&183 while (( "$lines" < "$pno" ))84 do85 echo "# of lines ($lines) < # of processes ($pno) "86 pno=`expr $pno / 2`87 done88 echo "pno: "$pno89 nofiles=`expr $lines / \( $pno - 1 \)`90 nofiles=`expr $nofiles + 1 `91 echo "number of files: "$nofiles >> $scriptlog 2>&192 echo "deviding todo-file" >> $scriptlog 2>&193 for (( j=1 ; j <= $pno ; j++ ))94 do95 begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)96 end=$(echo "$begin + $nofiles - 1" | bc -l)97 echo "begin: "$begin >> $scriptlog 2>&198 echo "end: "$end >> $scriptlog 2>&199 file=${todofile}-${j}.txt100 echo "file: "$file >> $scriptlog 2>&1101 sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt102 done103 104 rm -v $todofile.txt >> $scriptlog 2>&1105 79 fi 106 80 … … 109 83 nr=bla 110 84 echo "finding the right todo-file" >> $scriptlog 2>&1 111 for (( i = 1; i <= $pno ; i++ )) 85 todofiles=`ls $listpath/*` 86 87 echo "todofiles: "${todofiles[@]} >> $scriptlog 2>&1 88 89 90 for todofile in ${todofiles[@]} 112 91 do 113 if ! ls $todofile -$i.txt>> $scriptlog 2>&192 if ! ls $todofile >> $scriptlog 2>&1 114 93 then 115 94 echo "file is not on disk -> continue" >> $scriptlog 2>&1 116 95 continue 117 96 fi 118 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 97 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 98 date > $lockfile >> $scriptlog 2>&1 119 99 checklock=$? 120 100 case $checklock in … … 135 115 136 116 137 sequences=(`cat $todofile -$nr.txt`)117 sequences=(`cat $todofile`) 138 118 139 119 if [ "$sequences" = "" ] 140 120 then 141 121 echo "nothing to do -> exit" >> $scriptlog 2>&1 142 rm -v $todofile -$nr.txt>> $scriptlog 2>&1143 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1122 rm -v $todofile >> $scriptlog 2>&1 123 rm -v $lockfile >> $scriptlog 2>&1 144 124 date >> $scriptlog 2>&1 145 125 exit … … 182 162 done 183 163 184 rm -v $todofile -$nr.txt>> $scriptlog 2>&1185 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1164 rm -v $todofile >> $scriptlog 2>&1 165 rm -v $lockfile >> $scriptlog 2>&1 186 166 187 167 set +C
Note:
See TracChangeset
for help on using the changeset viewer.