Changeset 10041 for trunk/Mars/datacenter/scripts
- Timestamp:
- 10/27/10 17:48:15 (14 years ago)
- Location:
- trunk/Mars/datacenter/scripts
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/datacenter/scripts/runcallisto_mc
r9920 r10041 37 37 38 38 # get sequence # 39 gettodo "1" 40 sequence=${primaries[0]} 41 cereskey=${primaries[1]} 42 43 # lock sequ for cal 44 lockfile=$lockpath/lock-$step-$sequence-$cereskey.txt 45 checklock 39 numchanged=0 40 while (( 0 < 21 )) 41 do 42 if ! [ $numchanged -eq 1 ] 43 then 44 if ! [ "$sequence" = "" ] && ! [ "$cereskey" = "" ] 45 then 46 printprocesslog "INFO $program for sequence $sequence cereskey $cereskey is already running => request new number " 47 fi 48 gettodo "1" 49 sequence=${primaries[0]} 50 cereskey=${primaries[1]} 51 if [ "$sequence" = "" ] || [ "$cereskey" = "" ] 52 then 53 printprocesslog "INFO nothing to do for $program " 54 fi 55 else 56 printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey" 57 break 58 fi 59 setstatus "start" 60 done 46 61 47 62 cd $mars 48 63 49 64 # run calibration for sequence 50 printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"51 65 52 66 # define files and paths … … 57 71 callistorc=$setuppath/$program/`printf %03d $cereskey`/callisto.rc 58 72 inpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8` 59 60 setstatus "start"61 73 62 74 command="./callisto -b -q -v4 -f --out=$outpath --ind=$inpath --log=$log.log --html=$log.html --config=$callistorc $sequfile" -
trunk/Mars/datacenter/scripts/runceres
r9919 r10041 37 37 set -C 38 38 39 # get sequence # 40 gettodo "1" 41 run=${primaries[0]} 42 cereskey=${primaries[1]} 43 44 # lock sequ for cal 45 lockfile=$lockpath/lock-$step-$run.$cereskey.txt 46 checklock 39 # get run # 40 numchanged=0 41 while (( 0 < 21 )) 42 do 43 if ! [ $numchanged -eq 1 ] 44 then 45 if ! [ "$run" = "" ] && ! [ "$cereskey" = "" ] 46 then 47 printprocesslog "INFO $program for run $run cereskey $cereskey is already running => request new number " 48 fi 49 gettodo "1" 50 run=${primaries[0]} 51 cereskey=${primaries[1]} 52 if [ "$run" = "" ] || [ "$cereskey" = "" ] 53 then 54 printprocesslog "INFO nothing to do for $program " 55 fi 56 else 57 printprocesslog "INFO starting $program for run $run cereskey $cereskey" 58 break 59 fi 60 setstatus "start" 61 done 47 62 48 63 cd $mars 49 64 50 # run calibration for sequence 51 printprocesslog "INFO starting $program for run $run and ceres-setup $cereskey" 52 53 setstatus "start" 65 # run ceres for run 54 66 55 67 setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc -
trunk/Mars/datacenter/scripts/runcorsika
r10006 r10041 144 144 145 145 146 # get sequence # 147 gettodo "1" 148 run=${primaries[0]} 149 file=${primaries[1]} 150 151 # lock sequ 152 lockfile=$lockpath/lock-$step-$run.$file.txt 153 checklock 154 155 printprocesslog "INFO starting $program for run $run and file $file" 156 157 setstatus "start" 158 146 # get run # and file # 147 numchanged=0 148 while (( 0 < 21 )) 149 do 150 if ! [ $numchanged -eq 1 ] 151 then 152 if ! [ "$run" = "" ] && ! [ "$file" = "" ] 153 then 154 printprocesslog "INFO $program for run $run and file $file is already running => request new number " 155 fi 156 gettodo "1" 157 run=${primaries[0]} 158 file=${primaries[1]} 159 if [ "$run" = "" ] || [ "$file" = "" ] 160 then 161 printprocesslog "INFO nothing to do for $program " 162 fi 163 else 164 printprocesslog "INFO starting $program for run $run and file $file" 165 break 166 fi 167 setstatus "start" 168 done 169 170 # running corsika 159 171 printprocesslog "INFO run $program for run $run and file $file" 160 172 printprocesslog "INFO create input card for run $run and file $file" -
trunk/Mars/datacenter/scripts/runstar_mc
r9611 r10041 36 36 37 37 # get sequence # 38 gettodo "1" 39 sequence=${primaries[0]} 40 cereskey=${primaries[1]} 41 42 # lock sequ for cal 43 lockfile=$lockpath/lock-$step-$sequence-$cereskey.txt 44 checklock 38 numchanged=0 39 while (( 0 < 21 )) 40 do 41 if ! [ $numchanged -eq 1 ] 42 then 43 if ! [ "$sequence" = "" ] && ! [ "$cereskey" = "" ] 44 then 45 printprocesslog "INFO $program for sequence $sequence cereskey $cereskey is already running => request new number " 46 fi 47 gettodo "1" 48 sequence=${primaries[0]} 49 cereskey=${primaries[1]} 50 if [ "$sequence" = "" ] || [ "$cereskey" = "" ] 51 then 52 printprocesslog "INFO nothing to do for $program " 53 fi 54 else 55 printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey" 56 break 57 fi 58 setstatus "start" 59 done 45 60 46 61 cd $mars 47 62 48 63 # run calibration for sequence 49 printprocesslog "INFO starting $program for sequence $sequence cereskey $cereskey"50 64 51 65 # define files and paths … … 55 69 log=$outpath/$program`printf %08d $sequence` 56 70 inpath=$mcpath/callisto/`printf %03d $cereskey`/`printf %08d $sequence | cut -c 1-4`/`printf %08d $sequence | cut -c 5-8` 57 58 setstatus "start"59 71 60 72 command="./star -b -q -v4 -f --ind=$inpath --out=$outpath --log=$log.log --html=$log.html $sequfile" -
trunk/Mars/datacenter/scripts/sourcefile
r10007 r10041 48 48 export SOURCEFILEPATH=`dirname $0` 49 49 fi 50 51 # possible solution for $0 problem:52 # ${BASH_SOURCE[0]} 53 # but has to be checked and tested more carefully 54 # should solve at least problem with login-shell and with source 50 if [ "$SCRIPTNAME" = "" ] 51 then 52 SCRIPTNAME=`basename $0` 53 fi 54 55 55 source $SOURCEFILEPATH/setup.$AUTOMATIONSETUP 56 56 … … 68 68 if ! [ "$processlog" = "" ] 69 69 then 70 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] ERROR could not make dir "$@ >> $processlog70 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] ERROR could not make dir "$@ >> $processlog 71 71 else 72 72 echo "could not make dir "$@ … … 95 95 { 96 96 makedir $processlogpath 97 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] "$@ >> $processlog97 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] "$@ >> $processlog 98 98 } 99 99 … … 105 105 printprocesslog "DEBUG " `rm -v $lockfile` 106 106 fi 107 printprocesslog "DEBUG finished $0"107 printprocesslog "DEBUG finished "$SOURCEFILEPATH"/"$SCRIPTNAME 108 108 exit 109 109 } … … 153 153 function checklock() 154 154 { 155 if ! echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] "`uname -a` > $lockfile 2>/dev/null155 if ! echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] "`uname -a` > $lockfile 2>/dev/null 156 156 then 157 157 printprocesslog "WARN lockfile $lockfile exists" … … 424 424 do 425 425 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}+$j]}' " 426 done 426 done 427 # add additional query to allow for locking in db 428 if [ "$1" = "start" ] 429 then 430 query=$query" AND ISNULL("$step"Status.fStartTime) " 431 fi 432 # add row count to know how many rows have been changed 433 query=$query"; SELECT ROW_COUNT();" 427 434 # print query 428 435 printprocesslog "DEBUG setstatus for step $step QUERY: "$query 429 436 # execute query 430 if ! mysql -s -u $us --password=$pw --host=$ho $db -e " $query "437 if ! numchanged=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "` 431 438 then 432 439 printprocesslog "ERROR could not set status in db (program: $program, function setstatus)" 433 440 finish 441 fi 442 if [ $numchanged -gt 0 ] 443 then 444 printprocesslog "INFO successful setting of status in db (program: $program, function setstatus)" 445 else 446 printprocesslog "INFO status in db was already set by other process (program: $program, function setstatus)" 434 447 fi 435 448 }
Note:
See TracChangeset
for help on using the changeset viewer.