Changeset 7806 for trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
- Timestamp:
- 07/26/06 15:20:28 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
r7486 r7806 48 48 source /home/$user/Mars/datacenter/scripts/sourcefile 49 49 50 set -C 51 50 52 cd $mars 53 54 program=filesondisk 55 56 lockfile=$lockpath/lock-$program.txt 57 58 scriptlogpath=$logpath/run/$program/`date +%Y` 59 makedir $scriptlogpath 60 scriptlog=$scriptlogpath/$program-$datetime.log 61 62 date >> $scriptlog 2>&1 63 64 # check if script is already running 65 checklock >> $scriptlog 2>&1 66 51 67 date=`date +%F` 52 68 53 69 subsystemdir=/magic/subsystemdata 54 filesondisklogpath=$logpath/ filesondisk/`date +%Y`70 filesondisklogpath=$logpath/$program/`date +%Y/%m` 55 71 makedir $filesondisklogpath 56 72 57 73 58 echo "checking disk for ccfiles..." 59 filename=$filesondisklogpath/ccfilesondisk-$date .txt74 echo "checking disk for ccfiles..." >> $scriptlog 2>&1 75 filename=$filesondisklogpath/ccfilesondisk-$datetime.txt 60 76 column=fCCFileAvail 61 77 find $subsystemdir/cc/ -name '*_S.rep' | cut -d_ -f2 > $filename 62 78 63 echo "resetting runs..." 64 check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date .log | grep int | sed -e 's/(int)//'`79 echo "resetting runs..." >> $scriptlog 2>&1 80 check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'` 65 81 66 82 case $check3 in 67 1) echo "check3=$check3 -> everything ok -> reset is done" ;;68 *) echo "check3=$check3 -> ERROR -> something went wrong while resetting" ;;83 1) echo "check3=$check3 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 84 *) echo "check3=$check3 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 69 85 esac 70 86 71 87 72 echo "checking disk for cacofiles..." 73 filename=$filesondisklogpath/cacofilesondisk-$date .txt88 echo "checking disk for cacofiles..." >> $scriptlog 2>&1 89 filename=$filesondisklogpath/cacofilesondisk-$datetime.txt 74 90 column=fCaCoFileAvail 75 91 find $subsystemdir/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename 76 92 77 echo "resetting runs..." 78 check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date .log | grep int | sed -e 's/(int)//'`93 echo "resetting runs..." >> $scriptlog 2>&1 94 check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'` 79 95 80 96 case $check0 in 81 1) echo "check0=$check0 -> everything ok -> reset is done" ;;82 *) echo "check0=$check0 -> ERROR -> something went wrong while resetting" ;;97 1) echo "check0=$check0 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 98 *) echo "check0=$check0 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 83 99 esac 84 100 85 echo "checking missing cacofiles..." 86 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$date .log | grep int | sed -e 's/(int)//'`101 echo "checking missing cacofiles..." >> $scriptlog 2>&1 102 check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | grep int | sed -e 's/(int)//'` 87 103 88 104 case $check1 in 89 1) echo "check1=$check1 -> everything ok -> missing cacofiles are found" ;;90 *) echo "check1=$check1 -> ERROR -> something went wrong while resetting" ;;105 1) echo "check1=$check1 -> everything ok -> missing cacofiles are found" >> $scriptlog 2>&1 ;; 106 *) echo "check1=$check1 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 91 107 esac 92 108 … … 95 111 do 96 112 runno=$missingcacorun 97 echo "no cacofile found for run "$runno 98 echo "finding cacofile" 113 echo "no cacofile found for run "$runno >> $scriptlog 2>&1 114 echo "finding cacofile" >> $scriptlog 2>&1 99 115 ccfile=`find $subsystemdir/cc/ -name [2][0][0-2][0-9][0,1][0-9][0-3][0-9]_*${runno}_[P,D,C,S]_*_S.rep` 100 echo "ccfile: "$ccfile 116 echo "ccfile: "$ccfile >> $scriptlog 2>&1 101 117 if [ "$ccfile" = "" ] 102 118 then 103 echo "no ccfile found for run "$runno 119 echo "no ccfile found for run "$runno >> $scriptlog 2>&1 104 120 continue 105 121 fi … … 114 130 continue 115 131 else 116 echo "inserting cacofile $file for run $missingcacorun..." 132 echo "inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1 117 133 check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'` 118 134 119 135 case $check2 in 120 1) echo "check2=$check2 -> everything ok -> insert is done" ;;121 *) echo "check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun ;;136 1) echo "check2=$check2 -> everything ok -> insert is done" >> $scriptlog 2>&1 ;; 137 *) echo "check2=$check2 -> ERROR -> something went wrong while inserting run "$missingcacorun >> $scriptlog 2>&1 ;; 122 138 esac 123 139 break 124 140 fi 125 141 done 126 echo "cacofile: "$cacofile 142 echo "cacofile: "$cacofile >> $scriptlog 2>&1 127 143 128 144 done 129 145 130 146 131 echo "checking disk for rawfiles..." 132 filename=$filesondisklogpath/rawfilesondisk-$date .txt147 echo "checking disk for rawfiles..." >> $scriptlog 2>&1 148 filename=$filesondisklogpath/rawfilesondisk-$datetime.txt 133 149 column=fRawFileAvail 134 150 find $datapath -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename 135 151 136 echo "resetting runs..." 137 check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date .log | grep int | sed -e 's/(int)//'`152 echo "resetting runs..." >> $scriptlog 2>&1 153 check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'` 138 154 139 155 case $check4 in 140 1) echo "check4=$check4 -> everything ok -> reset is done" ;;141 *) echo "check4=$check4 -> ERROR -> something went wrong while resetting" ;;156 1) echo "check4=$check4 -> everything ok -> reset is done" >> $scriptlog 2>&1 ;; 157 *) echo "check4=$check4 -> ERROR -> something went wrong while resetting" >> $scriptlog 2>&1 ;; 142 158 esac 143 159 160 finish >> $scriptlog 2>&1 144 161 162
Note:
See TracChangeset
for help on using the changeset viewer.