Changeset 7927 for trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
- Timestamp:
- 08/24/06 12:15:46 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7925 r7927 70 70 Ffillganymed=21 71 71 72 # 72 73 # setup for jobmanager 74 # 73 75 steps=$mars/steps.rc 74 76 # resetting values 75 77 pno=0 76 78 totalpno=0 … … 79 81 runningscript=0 80 82 queuedscript=0 81 83 stillinqueue=0 82 84 83 85 function setzero() … … 100 102 101 103 102 103 104 # in the following the function, which are needed by several scripts, are 104 105 # defined … … 113 114 } 114 115 115 # function to do continue in a loop or exit the program depending on what is needed 116 function contex() 117 { 116 # function to do continue in a loop and produce according logging 117 function cont() 118 { 119 date 118 120 echo "" 119 if [ "$singleprocess" = "yes" ] 120 then 121 continue 122 else 123 finish 124 fi 121 continue 125 122 } 126 123 … … 148 145 1) echo " checklock0=$checklock0 -> file $lockfile exists -> exit" 149 146 date 150 contex;;147 exit;; 151 148 *) echo " checklock0=$checklock0 -> something went completely wrong" ;; 152 149 esac … … 154 151 155 152 # function calling the macro, which is producing the todo-list 156 function getdolist ()153 function getdolistroot() 157 154 { 158 155 datetime=`date +%F-%H-%M-%S` … … 278 275 279 276 # function to get todolist 280 function get todo()281 { 282 echo "getting todo ..."277 function getdolist() 278 { 279 echo "getting todolist..." 283 280 getdbsetup 284 if [ "$singleprocess" = "yes" ]285 then286 column=${scriptscolname[$i]}287 fi288 281 getstepinfo 289 282 # get query … … 296 289 done 297 290 fi 298 if ! echo $influences | grep '#' > /dev/null299 then300 for influence in $influences301 do302 query=$query" isnull($influence) and"303 done304 fi305 291 query=$query" isnull($column) " 306 292 query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) " 307 293 query=$query" order by $primary desc " 308 if [ "$singleprocess" = "yes" ]309 then310 query=$query" limit 0, 1 "311 fi312 294 # echo " QUERY: "$query 313 295 if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 314 296 then 315 echo "ERROR could not query process from db -> contex" 316 rm -v $lockfile 317 contex 297 echo "ERROR could not query process from db -> exit" 298 finish 318 299 fi 319 300 … … 321 302 then 322 303 echo " => nothing to do" 323 rm -v $lockfile 324 contex 304 finish 325 305 else 326 if [ "$singleprocess" = "yes" ] 327 then 328 todofile=$listpath/ToDo-$table-$column-$process.txt 329 echo " => found $process" 330 else 331 todofile=$listpath/ToDo-$table-$column.txt 332 echo "found processes" 333 fi 334 # echo " list: "$todofile 306 todofile=$listpath/ToDo-$table-$column.txt 335 307 336 308 if ls $todofile > /dev/null 2>&1 337 309 then 338 310 echo "$todofile exists already" 339 rm -v $lockfile 340 contex 311 finish 341 312 fi 313 echo "found processes, writing todofile..." 342 314 echo $process > $todofile 315 fi 316 } 317 318 # function to get todo (process) 319 function gettodo() 320 { 321 process= 322 echo "getting todo..." 323 getdbsetup 324 getstepinfo 325 # get query 326 query=" select $primary from $table where " 327 if ! echo $needs | grep '#' > /dev/null 328 then 329 for need in $needs 330 do 331 query=$query" not isnull($need) and" 332 done 333 fi 334 query=$query" isnull($column) " 335 query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) " 336 query=$query" order by $primary desc " 337 query=$query" limit 0, 1 " 338 # echo " QUERY: "$query 339 if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 340 then 341 echo "ERROR could not query process from db -> exit" 342 finish 343 fi 344 345 if [ "$process" = "" ] 346 then 347 echo " => nothing to do -> exit" 348 finish 349 fi 350 } 351 352 # function to get the number of processes which still have to be done 353 function getstatus() 354 { 355 numproc= 356 echo "getting status..." 357 getdbsetup 358 column=${scriptscolname[$i]} 359 getstepinfo 360 # get query 361 query=" select count(*) from $table where " 362 if ! echo $needs | grep '#' > /dev/null 363 then 364 for need in $needs 365 do 366 query=$query" not isnull($need) and" 367 done 368 fi 369 query=$query" isnull($column) " 370 query=$query" and isnull(fStartTime) and isnull(fFailedTime) and isnull(fFailedCode) and isnull(fFailedCodeAdd) and isnull(fReturnCode) " 371 query=$query" group by $column " 372 # echo " QUERY: "$query 373 if ! numproc=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 374 then 375 echo "ERROR could not query number of todo proceses from db -> continue" 376 cont 343 377 fi 344 378 } … … 349 383 resetstatusvalues 350 384 evalstatus $@ 351 352 echo "setting todo..."353 385 getdbsetup 354 386 getstepinfo 355 387 # get query 356 388 reset=`grep "$coltab[.]Reset:" $steps | sed -e "s/$coltab[.]Reset://" -e 's/ //g'` 357 echo -$reset-358 389 if [ "$reset" = "no" ] 359 390 then
Note:
See TracChangeset
for help on using the changeset viewer.