Changeset 7908 for trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
- Timestamp:
- 08/22/06 13:05:14 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/jobmanager
r7906 r7908 30 30 31 31 32 #source `dirname $0`/sourcefile (is done in jobsourcefile) 33 32 source `dirname $0`/sourcefile 34 33 user=`whoami` 35 sourcefile=/home/$user/Mars.cvs/datacenter/scripts/jobsourcefile36 source $sourcefile37 34 38 35 notcount=0 … … 46 43 dayofweek=`date +%u` 47 44 hour=`date +%k` 48 source $sourcefile45 source `dirname $0`/sourcefile 49 46 echo "script: ${scripts[$i]}" #>> $scriptlog 2>&1 50 echo " day: $dayofweek hour: $hour" #>> $scriptlog 2>&147 # echo " day: $dayofweek hour: $hour" #>> $scriptlog 2>&1 51 48 queued=`/usr/local/bin/condor_q -global -format "%s\n" Owner | grep -c $user` 52 49 queued=`setzero $queued` 53 echo " found $queued jobs in the queue (incl. running jobs)" #>> $scriptlog 2>&154 50 queuedscript=`/usr/local/bin/condor_q -global | grep $user | grep -c ${scripts[$i]}` 55 51 queuedscript=`setzero $queuedscript` 56 echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs)" #>> $scriptlog 2>&157 52 58 53 pnototal=${pnototal[$hour]} … … 64 59 num=`echo "((( $i + 1 ) * 24 ) + ( $hour + 1 ) ) - 24 - 1 " | bc ` 65 60 pnoscript=${pnos[$num]} 66 echo " => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" #>> $scriptlog 2>&1 61 echo " found $queued jobs in the queue (incl. running jobs) [allowed $pnototal]" #>> $scriptlog 2>&1 62 echo " found $queuedscript ${scripts[$i]} in the queue (incl. running jobs) [allowed $pnoscript]" #>> $scriptlog 2>&1 63 # echo " => num=$num => pnoscript=$pnoscript (i.e. $pnoscript ${scripts[$i]} allowed)" #>> $scriptlog 2>&1 67 64 68 echo " queued: $queued - pnototal: $pnototal" #>> $scriptlog 2>&169 65 if [ "$queued" -gt "$pnototal" ] 70 66 then 71 67 continue 72 68 else 73 echo " queued ${scripts[$i]}: $queuedscript - pno: $pnoscript" #>> $scriptlog 2>&174 69 if [ "$queuedscript" -gt "$pnoscript" ] 75 70 then … … 77 72 fi 78 73 fi 79 80 echo " gettodo..."81 echo "getting db..."82 db=`grep Database $mars/sql.rc | grep -v '#' | sed -e 's/Database: //' -e 's/ //g'`83 col=${scriptscolname[$i]}84 table=`grep "$col:" $steps | sed -e "s/[.]$col://" -e 's/#//' -e 's/ //g'`85 coltab=`grep "$col:" $steps | sed -e 's/://' -e 's/#//' -e 's/ //g'`86 needs=`grep "$coltab[.]Needs:" $steps | sed -e "s/$coltab[.]Needs://"`87 influences=`grep "$coltab[.]Influences:" $steps | sed -e "s/$coltab[.]Influences://"`88 primary=fSequenceFirst89 echo "db: $db - col $col - table $table - coltab $coltab"90 echo "needs: $needs"91 echo "influences: $influences"92 query="select $primary from $table where "93 for need in $needs94 do95 query=$query" not isnull($need) and"96 done97 for influence in $influences98 do99 query=$query" isnull($influence) and"100 done101 query=$query" isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) order by $primary desc limit 0, 1 "102 echo "QUERY: "$query103 echo ""104 echo " gettodofiles -> pno"105 74 106 if [ "$pno" == "0" ] 107 then 108 echo " pno = $pno -> continue" #>> $scriptlog 2>&1 109 echo "" #>> $scriptlog 2>&1 110 continue 111 fi 75 singleprocess="yes" 76 gettodo 112 77 113 78 y=`date +%Y` … … 115 80 d=`date +%d` 116 81 condordir=$logpath/condor/$y/$m/$d 117 makedir 82 makedir $condordir #>> $scriptlog 2>&1 118 83 119 echo " ---> starting $pno ${scripts[$i]}..." #>> $scriptlog 2>&184 # echo " ---> starting ${scripts[$i]} for $process" #>> $scriptlog 2>&1 120 85 121 86 #test 122 echo "" 123 continue 87 contex 124 88 #test 125 89 if ! /usr/local/bin/condor_submit -a path=$scriptspath -a prog=${scripts[$i]} -a y=$y -a m=$m -a d=$d $scriptspath/run.condor 2>$errorlog
Note:
See TracChangeset
for help on using the changeset viewer.