Ignore:
Timestamp:
07/26/06 15:20:28 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/filesondisk

    r7486 r7806  
    4848source /home/$user/Mars/datacenter/scripts/sourcefile
    4949
     50set -C
     51
    5052cd $mars
     53
     54program=filesondisk
     55
     56lockfile=$lockpath/lock-$program.txt
     57
     58scriptlogpath=$logpath/run/$program/`date +%Y`
     59makedir $scriptlogpath
     60scriptlog=$scriptlogpath/$program-$datetime.log
     61
     62date >> $scriptlog 2>&1
     63
     64# check if script is already running
     65checklock  >> $scriptlog 2>&1
     66
    5167date=`date +%F`
    5268
    5369subsystemdir=/magic/subsystemdata
    54 filesondisklogpath=$logpath/filesondisk/`date +%Y`
     70filesondisklogpath=$logpath/$program/`date +%Y/%m`
    5571makedir $filesondisklogpath
    5672
    5773
    58 echo "checking disk for ccfiles..."
    59 filename=$filesondisklogpath/ccfilesondisk-$date.txt
     74echo "checking disk for ccfiles..."  >> $scriptlog 2>&1
     75filename=$filesondisklogpath/ccfilesondisk-$datetime.txt
    6076column=fCCFileAvail
    6177find $subsystemdir/cc/ -name '*_S.rep' | cut -d_ -f2  > $filename
    6278
    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)//'`
     79echo "resetting runs..." >> $scriptlog 2>&1
     80check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'`
    6581
    6682case $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 ;;
    6985esac
    7086
    7187
    72 echo "checking disk for cacofiles..."
    73 filename=$filesondisklogpath/cacofilesondisk-$date.txt
     88echo "checking disk for cacofiles..."  >> $scriptlog 2>&1
     89filename=$filesondisklogpath/cacofilesondisk-$datetime.txt
    7490column=fCaCoFileAvail
    7591find $subsystemdir/caco/ -name '*.txt' | cut -d_ -f8 | grep [0-9] > $filename
    7692
    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)//'`
     93echo "resetting runs..." >> $scriptlog 2>&1
     94check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'`
    7995
    8096case $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 ;;
    8399esac
    84100
    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)//'`
     101echo "checking missing cacofiles..." >> $scriptlog 2>&1
     102check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | grep int | sed -e 's/(int)//'`
    87103
    88104case $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 ;;
    91107esac
    92108
     
    95111do
    96112   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
    99115   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
    101117   if [ "$ccfile" = "" ]
    102118   then
    103       echo "no ccfile found for run "$runno
     119      echo "no ccfile found for run "$runno >> $scriptlog 2>&1
    104120      continue
    105121   fi
     
    114130         continue
    115131      else
    116          echo "inserting cacofile $file for run $missingcacorun..."
     132         echo "inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1
    117133         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'`
    118134
    119135         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 ;;
    122138         esac
    123139         break
    124140      fi
    125141   done
    126    echo "cacofile: "$cacofile
     142   echo "cacofile: "$cacofile >> $scriptlog 2>&1
    127143
    128144done
    129145
    130146
    131 echo "checking disk for rawfiles..."
    132 filename=$filesondisklogpath/rawfilesondisk-$date.txt
     147echo "checking disk for rawfiles..."  >> $scriptlog 2>&1
     148filename=$filesondisklogpath/rawfilesondisk-$datetime.txt
    133149column=fRawFileAvail
    134150find $datapath -name '*.raw' -o -name '*.gz' | cut -d_ -f2 > $filename
    135151
    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)//'`
     152echo "resetting runs..." >> $scriptlog 2>&1
     153check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'`
    138154
    139155case $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 ;;
    142158esac
    143159
     160finish >> $scriptlog 2>&1
    144161
     162
Note: See TracChangeset for help on using the changeset viewer.