Changeset 9081 for trunk/MagicSoft/Mars/datacenter/scripts
- Timestamp:
- 08/04/08 13:41:17 (16 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/cutslices
r9046 r9081 20 20 # Author(s): Stefan Ruegamer 12/2007 <mailto:snruegam@astro.uni-wuerzburg.de> 21 21 # 22 # Copyright: MAGIC Software Development, 2000-200 722 # Copyright: MAGIC Software Development, 2000-2008 23 23 # 24 24 # … … 32 32 source `dirname $0`/sourcefile 33 33 printprocesslog "INFO starting $0" 34 echo "This script has not been adapted to the new file structure (MAGIC II). "35 echo "Please adapt it before using it."36 exit37 38 34 program=compmux 39 35 column=fCompmux … … 41 37 set -C 42 38 43 scriptlog= /magic/datacenter/compmux/$program-$datetime.log39 scriptlog=$runlogpath/run$program-$datetime.log 44 40 date >> $scriptlog 2>&1 45 todofile=$listpath/ToDo-$table-$column.txt46 41 47 if [ -e $todofile ] 48 then 49 echo "$program is already running -> exit" >> $scriptlog 2>&1 50 exit 51 fi 52 53 #get todo list 54 getdolist >> $scriptlog 2>&1 55 56 #retrieving runs from todo file 57 files=(`cat $listpath/ToDo-$table-$column.txt`) 58 if [ "$files" = "" ] 59 then 60 echo "nothing to do -> exit" >> $scriptlog 2>&1 61 finish >> $scriptlog 2>&1 62 fi 63 64 for file in ${files[@]} 42 # query db 20 times for jobs 43 for ((j=0 ; j < 20 ; j++)) 65 44 do 66 echo -e "\ngetting path for run $file..." >> $scriptlog 2>&1 67 fullpath=`find $datapath/rawfiles/2007/0[2-9] -name *${file}_[DCPS]_*` 45 gettodo "1" >> $scriptlog 2>&1 46 runno=${primaries[0]} 47 tempfile=/data/tmp/temp${runno}.gz 68 48 69 lockfile=$lockpath/lock-$program-$file.txt 49 lockfile=$lockpath/lock-$table-$column-$runno.txt 50 checklock >> $scriptlog 2>&1 70 51 71 #check lock file and stop for this run if already being processed72 checklock continue >> $scriptlog 2>&173 74 primvar=$file75 52 setstatus "start" >> $scriptlog 2>&1 76 53 77 cd $mars 54 # try to find the file; if impossible, continue with an error 55 echo "getting path for run $runno..." >> $scriptlog 2>&1 56 printprocesslog "INFO starting $program for run $runno" 57 fullname=`find $datapath/rawfiles/2007/0[2-9] -name 20070*${runno}_[DCPS]_*.raw.gz` 58 arraycheck=`echo $fullname | wc -w` 59 if [ "$fullname" == "" ] || ! [ $arraycheck == 1 ] 60 then 61 echo "ERROR file for run $runno not found or more than one file found... continue" >> $scriptlog 2>&1 62 printprocesslog "ERROR $program failed, file for run $runno not found or more than one file found" 63 rm -v $lockpath/lock-$table-$column-$runno.txt >> $scriptlog 2>&1 64 check=20 65 com=$FCompmux 66 setstatus "stop" >> $scriptlog 2>&1 67 echo "" >> $scriptlog 2>&1 68 continue 69 fi 78 70 79 #cut the slices 80 gzip -cd $fullpath | $mars/datacenter/compmux | gzip -1c > /tmp/temp${file}.gz 81 check1=$? 82 touch -r $fullpath /tmp/temp${file}.gz 71 # cut the slices 72 check1=`ssh -nx phoenix 'cd /home/operator/compmux ; nice -n 19 gzip -cd' $fullname '| nice -n 19 ./compmux | nice -n 19 gzip -1c > /data/tmp/temp'${runno}.gz ' ; echo ${PIPESTATUS[1]}'` 83 73 84 # check success and insert information into the database74 # check success and insert information into the database 85 75 case $check1 in 86 0) echo " check1=$check1 -> everything ok -> compmux succeeded, overwriting old file for run $file" >> $scriptlog 2>&1 87 mv -f /tmp/temp${file}.gz $fullpath >> $scriptlog 2>&1 76 0) echo " check1=$check1 -> everything ok -> compmux succeeded, overwriting old file for run $runno" >> $scriptlog 2>&1 77 ssh -nx phoenix nice -n 19 touch -r $fullname $tempfile 78 ssh -nx phoenix nice -n 19 mv -f $tempfile $fullname >> $scriptlog 2>&1 88 79 check2=$? 89 chmod a=r $fullpath90 80 case $check2 in 91 0) echo " check2=$check2 -> everything ok -> mv done, setting db status for run $ file" >> $scriptlog 2>&192 rm -v $lockfile >> $scriptlog 2>&181 0) echo " check2=$check2 -> everything ok -> mv done, setting db status for run $runno" >> $scriptlog 2>&1 82 ssh -nx phoenix nice -n 19 chmod a=r $fullname 93 83 ;; 94 *) echo " check2=$check2 -> ERROR - moving of run $file failed -> continue" >> $scriptlog 2>&1 95 continue 84 *) echo " check2=$check2 -> ERROR - moving of run $runno failed" >> $scriptlog 2>&1 85 printprocesslog "ERROR $program failed, moving of run $runno failed" 86 check=$check2 87 com=$FCompmux 96 88 ;; 97 89 esac 90 printprocesslog "INFO $program finished successfully for run $runno" 98 91 ;; 99 *) echo " check1=$check1 -> ERROR - $program failed for run $file" >> $scriptlog 2>&1 100 com=$FCompmux 92 *) echo " check1=$check1 -> ERROR - $program failed for run $runno" >> $scriptlog 2>&1 93 printprocesslog "ERROR $program failed for run $runno" 94 rm -v $tempfile >> $scriptlog 2>&1 101 95 check=$check1 96 com=$FCompmux 102 97 ;; 103 98 esac 104 99 100 rm -v $lockpath/lock-$table-$column-$runno.txt >> $scriptlog 2>&1 105 101 setstatus "stop" >> $scriptlog 2>&1 102 echo "" >> $scriptlog 2>&1 106 103 done 104 105 finish >> $scriptlog 2>&1 -
trunk/MagicSoft/Mars/datacenter/scripts/movingrawfiles
r8682 r9081 21 21 # Author(s): Stefan Ruegamer 02/2007 <mailto:snruegam@astro.uni-wuerzburg.de> 22 22 # 23 # Copyright: MAGIC Software Development, 2000-200 723 # Copyright: MAGIC Software Development, 2000-2008 24 24 # 25 25 # … … 50 50 # change permission for files 51 51 ssh tape@dc07 chmod -R g+w /magic/datacenter/fromtape/rawdata/* >> $scriptlog 2>&1 52 # output for chmod with -v or -c (only changes)53 54 # outdated, .finished files are no longer used55 #printprocesslog "INFO moving directories from fromlapalma to fromtape"56 # find directories which have to be copied57 #dirs=`ls /magic/datacenter/fromlapalma/RAWchk/*/*.finished | sed -e 's/RAWchk/RAW/g' | cut -d/ -f1-6`58 #if [ ! "$dirs" == "" ]59 #then60 # change permission for this directories61 #ssh lapalma@dc09 chmod -R g+w $dirs >> $scriptlog 2>&162 # move directories to the tapedirectory63 #mv -v $dirs /magic/datacenter/fromtape/rawdata/ >> $scriptlog 2>&164 #fi65 52 66 53 printprocesslog "INFO moving directories from muxdata to rawdata" … … 73 60 fi 74 61 75 76 62 # find rawfiles 77 rawfiles=`find /magic/ datacenter/fromtape/rawdata/ -name '*.*'`63 rawfiles=`find /magic/{datacenter,data/rawfiles}/fromtape/*data/ -regextype posix-egrep -regex '.*/20[01][0-9]{5}_(M[12]_)?[0-9]{8}(\.[0-9]{3})?_.*.raw' -type f` 78 64 79 65 if [ "$rawfiles" == "" ] … … 88 74 # workaround for rawfiles with wrong timing 89 75 # newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles-wrong-timing/g' -e 's/_/\//1' -e 's/_/\//1'` 90 newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'` 76 path=`dirname $rawfile | cut -d/ -f3` 77 if [ "$path" == "datacenter" ] 78 then 79 newrawfile=`echo $rawfile | sed -e 's/center\/fromtape\/rawdata/\/rawfiles/g' -e 's/_/\//1' -e 's/_/\//1'` 80 elif [ "$path" == "data" ] 81 then 82 newrawfile=`echo $rawfile | sed -e 's/\/fromtape\/muxdata//g' -e 's/_/\//1' -e 's/_/\//1'` 83 else 84 echo "ERROR something is wrong with the path of file $rawfile -> continue" >> $scriptlog 2>&1 85 printprocesslog "ERROR moving rawfile $rawfile failed" 86 continue 87 fi 88 91 89 newdir=`dirname $newrawfile` 92 90 makedir $newdir >> $scriptlog 2>&1 … … 95 93 done 96 94 97 rmdir -v /magic/ datacenter/fromtape/rawdata/* >> $scriptlog 2>&195 rmdir -v /magic/{datacenter,data/rawfiles}/fromtape/*data/* >> $scriptlog 2>&1 98 96 99 97 printprocesslog "INFO launching filesondisk" 100 98 echo "launching filesondisk" >> $scriptlog 2>&1 101 $scriptspath/filesondisk &99 $scriptspath/filesondisk & 102 100 103 101 finish >> $scriptlog 2>&1 104 -
trunk/MagicSoft/Mars/datacenter/scripts/setup
r9076 r9081 20 20 # Author(s): Daniela Dorner 05/2005 <mailto:dorner@astro.uni-wuerzburg.de> 21 21 # 22 # Copyright: MAGIC Software Development, 2000-200 822 # Copyright: MAGIC Software Development, 2000-2007 23 23 # 24 24 # … … 66 66 sleeptimelimit=360 #360 67 67 errorsleeptimedefault=60 #60 68 #max=18 #maximum number of processes69 68 max=42 #maximum number of processes 70 69 … … 73 72 #datascripts=( "runcallisto" "runstar" "runganymed" ) 74 73 #datascriptscolname=( "fCallisto" "fStar" "fGanymed" ) 75 datascripts=( "runganymed" "runstar" "runcallisto" )76 datascriptscolname=( "fGanymed" "fStar" "fCallisto" )74 datascripts=( "runganymed" "runstar" "runcallisto" "cutslices" ) 75 datascriptscolname=( "fGanymed" "fStar" "fCallisto" "fCompmux" ) 77 76 78 77 # … … 91 90 pnostar=( 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ) 92 91 pnoganymed=( 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ) 92 pnocutslices=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 93 93 #pnodatacheck=( 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ) 94 94 … … 96 96 pnostarwe=( 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 ) 97 97 pnoganymedwe=( 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 ) 98 pnocutsliceswe=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 98 99 #pnodatacheckwe=( 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 ) 99 100 100 # pnosweek=( ${pnocallisto[@]} ${pnostar[@]} ${pnoganymed[@]} ${pnodatacheck[@]} )101 # pnoswe=( ${pnocallistowe[@]} ${pnostarwe[@]} ${pnoganymedwe[@]} ${pnodatacheckwe[@]} )101 ##pnosweek=( ${pnocallisto[@]} ${pnostar[@]} ${pnoganymed[@]} ${pnodatacheck[@]} ) 102 ##pnoswe=( ${pnocallistowe[@]} ${pnostarwe[@]} ${pnoganymedwe[@]} ${pnodatacheckwe[@]} ) 102 103 #pnosweek=( ${pnocallisto[@]} ${pnostar[@]} ${pnoganymed[@]} ) 103 104 #pnoswe=( ${pnocallistowe[@]} ${pnostarwe[@]} ${pnoganymedwe[@]} ) 104 pnosweek=( ${pnoganymed[@]} ${pnostar[@]} ${pnocallisto[@]} )105 pnoswe=( ${pnoganymedwe[@]} ${pnostarwe[@]} ${pnocallistowe[@]} )105 pnosweek=( ${pnoganymed[@]} ${pnostar[@]} ${pnocallisto[@]} ${pnocutslices[@]} ) 106 pnoswe=( ${pnoganymedwe[@]} ${pnostarwe[@]} ${pnocallistowe[@]} ${pnocutsliceswe[@]} ) 106 107 108 # values for mc production 109 mcscripts=( "runcorsika" "runreflector" "runcamera" ) 110 mcscriptscolname=( "fCorsikaFileAvail" "fReflectorFileAvail" "fCameraFileAvail" ) 107 111 108 # not yet working completely112 #hour: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 109 113 110 ## values for mc production 111 #mcscripts=( "runcorsika" "runreflector" "runcamera" ) 112 #mcscriptscolname=( "fCorsikaFileAvail" "fReflectorFileAvail" "fCameraFileAvail" ) 113 # 114 ##hour: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 115 # 116 #pnocorsika=( 12 12 12 12 12 12 12 10 9 8 7 7 7 7 7 7 7 7 7 8 9 10 12 12 ) 117 #pnoreflector=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 118 #pnocamera=( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ) 119 # 120 #pnocorsikawe=( 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 12 ) 121 #pnoreflectorwe=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 122 #pnocamerawe=( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ) 123 # 114 pnocorsika=( 18 18 18 18 18 18 18 12 10 8 7 7 7 7 7 7 7 7 7 8 10 12 18 18 ) 115 pnoreflector=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 116 pnocamera=( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ) 117 118 pnocorsikawe=( 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 18 ) 119 pnoreflectorwe=( 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 ) 120 pnocamerawe=( 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 ) 121 124 122 #pnosweek=( ${pnocorsika[@]} ${pnoreflector[@]} ${pnocamera[@]} ) 125 123 #pnoswe=( ${pnocorsikawe[@]} ${pnoreflectorwe[@]} ${pnocamerawe[@]} )
Note:
See TracChangeset
for help on using the changeset viewer.