Changeset 7256 for trunk/MagicSoft/Mars/datacenter/scripts/runganymed
- Timestamp:
- 08/03/05 20:45:43 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/runganymed
r7233 r7256 37 37 datetime=`date +%F-%H-%M-%S` 38 38 year=`date +%Y` 39 pno=24 # number of processes, i.e. number of todo-files39 #pno=24 # number of processes, i.e. number of todo-files 40 40 41 41 todofile=$listpath/ToDo-$table-$column … … 78 78 *) echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;; 79 79 esac 80 echo "cutting to-do-file" >> $scriptlog 2>&181 echo "getting no of lines" >> $scriptlog 2>&182 lines=`cat $todofile.txt | wc -l`83 echo "number of lines: "$lines >> $scriptlog 2>&184 while (( "$lines" < "$pno" ))85 do86 echo "# of lines ($lines) < # of processes ($pno) "87 pno=`expr $pno / 2`88 done89 echo "pno: "$pno >> $scriptlog 2>&190 nofiles=`expr $lines / \( $pno - 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 80 fi 106 81 … … 109 84 nr=bla 110 85 echo "finding the right todo-file" >> $scriptlog 2>&1 111 for (( i = 1; i <= $pno ; i++ ))86 for todofile in ${todofiles[@]} 112 87 do 113 if ! ls $todofile -$i.txt>> $scriptlog 2>&188 if ! ls $todofile >> $scriptlog 2>&1 114 89 then 115 90 echo "file is not on disk -> continue" >> $scriptlog 2>&1 116 91 continue 117 92 fi 118 date > $lockpath/lock-$table-$column-$i.txt >> $scriptlog 2>&1 93 lockfile=`echo $todofile | sed -e 's/lists/locks/' -e 's/ToDo/lock/'` 94 date > $lockfile >> $scriptlog 2>&1 119 95 checklock=$? 120 96 case $checklock in … … 135 111 136 112 137 datasets=(`cat $todofile -$nr.txt`)113 datasets=(`cat $todofile`) 138 114 139 115 if [ "$datasets" = "" ] 140 116 then 141 117 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>&1118 rm -v $todofile >> $scriptlog 2>&1 119 rm -v $lockfile >> $scriptlog 2>&1 144 120 date >> $scriptlog 2>&1 145 121 exit … … 189 165 done 190 166 191 rm -v $todofile -$nr.txt>> $scriptlog 2>&1192 rm -v $lock path/lock-$table-$column-$nr.txt>> $scriptlog 2>&1167 rm -v $todofile >> $scriptlog 2>&1 168 rm -v $lockfile >> $scriptlog 2>&1 193 169 194 170 set +C
Note:
See TracChangeset
for help on using the changeset viewer.