Changeset 7917 for trunk/MagicSoft/Mars
- Timestamp:
- 08/22/06 20:03:34 (18 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r7916 r7917 46 46 - implemented functions to get todolist via shell 47 47 - improved logging 48 - replaced setstatus, implemented new function not calling root 49 but directly using shell and mysql to speed up the setting of 50 the status 48 51 49 52 * datacenter/scripts/jobmanager: -
trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
r7910 r7917 121 121 continue 122 122 else 123 exit123 finish 124 124 fi 125 125 } … … 199 199 } 200 200 201 # function calling the macro to set the status, after a process has finished 202 function setstatus() 203 { 204 # set status values 205 resetstatusvalues 201 # function evaluating the statusvalues 202 function evalstatus() 203 { 206 204 case $@ in 207 205 start) echo "setstatus start" … … 233 231 ;; 234 232 esac 233 } 234 235 # function calling the macro to set the status, after a process has finished 236 function setstatusroot() 237 { 238 # set status values 239 resetstatusvalues 240 evalstatus $@ 235 241 236 242 # printstatusvalues … … 260 266 function getstepinfo() 261 267 { 262 if [ "$singleprocess" = "yes" ]263 then264 column=${scriptscolname[$i]}265 fi266 268 table=`grep "$column:" $steps | sed -e "s/[.]$column://" -e 's/#//' -e 's/ //g'` 267 269 coltab=`grep "$column:" $steps | sed -e 's/://' -e 's/#//' -e 's/ //g'` … … 275 277 } 276 278 279 # function to get todolist 277 280 function gettodo() 278 281 { 279 282 echo "getting todo..." 280 283 getdbsetup 284 if [ "$singleprocess" = "yes" ] 285 then 286 column=${scriptscolname[$i]} 287 fi 281 288 getstepinfo 282 289 # get query … … 304 311 fi 305 312 # echo " QUERY: "$query 306 process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 313 if ! process=`mysql -s -u $us --password=$pw --host=hercules $db -e " $query "` 314 then 315 echo "ERROR could not query process from db -> contex" 316 contex 317 fi 307 318 308 319 if [ "$process" = "" ] … … 329 340 fi 330 341 } 342 343 # function to set status of a process in the db 344 function setstatus() 345 { 346 resetstatusvalues 347 evalstatus $@ 348 349 echo "setting todo..." 350 getdbsetup 351 getstepinfo 352 # get query 353 reset=`grep "$coltab[.]Reset:" $steps | sed -e "s/$coltab[.]Reset://" -e 's/ //g'` 354 echo -$reset- 355 if [ "$reset" = "no" ] 356 then 357 echo "YOU CAN'T RESET $column for $var2!!!" 358 finish 359 fi 360 query=" update $table set $column=$statustime" 361 if ! echo $influences | grep '#' > /dev/null 362 then 363 for influence in $influences 364 do 365 query=$query", $influence=NULL" 366 done 367 fi 368 query=$query", fStartTime=$starttime, fFailedTime=$failedtime, fFailedCode=$failedcode, fFailedCodeAdd=$failedcodeadd, fReturnCode=$returncode " 369 query=$query" where $primary=$var2" 370 echo " QUERY: "$query 371 if ! mysql -s -u $us --password=$pw --host=hercules $db -e " $query " 372 then 373 echo "ERROR could not insert status into db -> exit" 374 finish 375 fi 376 377 }
Note:
See TracChangeset
for help on using the changeset viewer.