Ignore:
Timestamp:
08/03/05 20:45:43 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/runganymed

    r7233 r7256  
    3737datetime=`date +%F-%H-%M-%S`
    3838year=`date +%Y`
    39 pno=24 # number of processes, i.e. number of todo-files
     39#pno=24 # number of processes, i.e. number of todo-files
    4040
    4141todofile=$listpath/ToDo-$table-$column
     
    7878       *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1;;
    7979   esac
    80    echo "cutting to-do-file" >> $scriptlog 2>&1
    81    echo "getting no of lines" >> $scriptlog 2>&1
    82    lines=`cat $todofile.txt | wc -l`
    83    echo "number of lines: "$lines >> $scriptlog 2>&1
    84    while (( "$lines" < "$pno" ))
    85    do
    86       echo "# of lines ($lines) < # of processes ($pno) "
    87       pno=`expr $pno / 2`
    88    done
    89    echo "pno: "$pno >> $scriptlog 2>&1
    90    nofiles=`expr $lines / \( $pno - 1 \)`
    91    echo "number of files: "$nofiles >> $scriptlog 2>&1
    92    echo "deviding todo-file" >> $scriptlog 2>&1
    93    for (( j=1 ; j <= $pno ; j++ ))
    94    do
    95      begin=$(echo "1 + ( ($j - 1) * $nofiles)" | bc -l)
    96      end=$(echo "$begin + $nofiles - 1" | bc -l)
    97      echo "begin: "$begin >> $scriptlog 2>&1
    98      echo "end: "$end >> $scriptlog 2>&1
    99      file=${todofile}-${j}.txt
    100      echo "file: "$file >> $scriptlog 2>&1
    101      sed -ne ''"$begin"','"$end"'w '"$file"'' $todofile.txt
    102    done
    103 
    104    rm -v $todofile.txt >> $scriptlog 2>&1
    10580fi
    10681
     
    10984nr=bla
    11085echo "finding the right todo-file" >> $scriptlog 2>&1
    111 for (( i = 1; i <= $pno ; i++ ))
     86for todofile in ${todofiles[@]}
    11287do
    113    if ! ls $todofile-$i.txt >> $scriptlog 2>&1
     88   if ! ls $todofile >> $scriptlog 2>&1
    11489   then
    11590      echo "file is not on disk -> continue" >> $scriptlog 2>&1
    11691      continue
    11792   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
    11995   checklock=$?
    12096   case $checklock in
     
    135111
    136112
    137 datasets=(`cat $todofile-$nr.txt`)
     113datasets=(`cat $todofile`)
    138114
    139115if [ "$datasets" = "" ]
    140116then
    141117   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    142    rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    143    rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     118   rm -v $todofile >> $scriptlog 2>&1
     119   rm -v $lockfile >> $scriptlog 2>&1
    144120   date  >> $scriptlog 2>&1
    145121   exit
     
    189165done
    190166
    191 rm -v $todofile-$nr.txt >> $scriptlog 2>&1
    192 rm -v $lockpath/lock-$table-$column-$nr.txt >> $scriptlog 2>&1
     167rm -v $todofile >> $scriptlog 2>&1
     168rm -v $lockfile >> $scriptlog 2>&1
    193169
    194170set +C
Note: See TracChangeset for help on using the changeset viewer.