Ignore:
Timestamp:
09/16/08 11:20:26 (16 years ago)
Author:
snruegam
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/datacenter/scripts
Files:
3 edited

Legend:

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

    r9063 r9136  
    3232olday=`date +%F --date="-30day"`
    3333
     34source `dirname $0`/sourcefile
     35printprocesslog "INFO starting $0"
     36
    3437set -C
    3538
     
    5962
    6063echo "writing all databases to $zipfile..." >> $logfile 2>&1
    61 set +C
     64
    6265# complete databases
    63 mysqldump --host=vela --all-databases -u dump | bzip2 -9 -c > $zipfile 2>> $logfile
     66if ! mysqldump --host=vela --all-databases -u dump | bzip2 -9 -c >| $zipfile 2>> $logfile
     67then
     68   printprocesslog "ERROR mysqldump failed "
     69   echo "ERROR mysqldump failed " >> $logfile 2>&1
     70fi
    6471echo "writing create commands to $command..." >> $logfile 2>&1
    6572# commands to create MyMagic
    66 mysqldump --host=vela --database $dbname -u dump --no-data > $command 2>> $logfile
     73if ! mysqldump --host=vela --database $dbname -u dump --no-data >| $command 2>> $logfile
     74then
     75   printprocesslog "ERROR mysqldump failed "
     76   echo "ERROR mysqldump failed " >> $logfile 2>&1
     77fi
    6778
     79finish >> $logfile 2>&1
    6880
  • trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum

    r9114 r9136  
    3030# transferred together with the logfile.
    3131#
    32 # The script will be automised by being executed after reading tapes with
    33 # the not-yet finished script readlapalmatapes. At the moment it is being
    34 # executed by hand.
    35 #
    3632
    37 echo "Please specify the tape number (e.g. 3MG005)."
    38 read no
    39 echo "Thank you. Your query is being processed. This may take some time."
     33no=$@
     34if [ "$no" == "" ]
     35then
     36   echo "no tape specified -> aborting"
     37   exit
     38fi
    4039
    4140checkpath=/home/lapalma/tapecont/cont/muxdata/checksums
     
    4342L=`echo $file | cut -c49`
    4443id=${no}L${L}
     44logfile=${checkpath}/tape_${id}.log
    4545
    4646if [ ! -f $file ]
    4747then
    48    echo "tape $file not found -> aborting"
     48   echo "tape $file not found -> aborting" >> $logfile 2>&1
    4949   exit
    5050fi
     
    5252if [ -f ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ]
    5353then
    54    echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
    55    read cont
    56    if [ ! $cont == "yes" ]
    57    then
    58       echo "Aborting."
    59       exit
    60    fi
     54   echo "Output files already existing -> aborting" >> $logfile 2>&1
     55   exit
     56#   echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
     57#   read cont
     58#   if [ ! $cont == "yes" ]
     59#   then
     60#      echo "Aborting."
     61#      exit
     62#   fi
     63fi
     64
     65if [ "`cat $file`" == "" ]
     66then
     67   echo "$file is empty, the checksums are missing -> aborting" >> $logfile 2>&1
     68   exit
    6169fi
    6270
     
    7785      if [ ! -f /magic/datacenter/fromtape/${sum[0]} ] && [ ! -f /data/fromtape/${sum[0]} ]
    7886      then
    79         echo "File ${sum[0]} does not exist."
     87        echo "File ${sum[0]} does not exist." >> $logfile 2>&1
    8088        continue
    8189      fi
     
    8694      if [ ! -f /magic/datacenter/fromtape/${sum[0]} ]
    8795      then
    88          ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
     96         nice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
    8997      else
    90          ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
    91          #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
     98         nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
    9299      fi
    93100   fi
     
    98105if [ ! -f ${checkpath}/tape_${id}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${id}.md5.wue ]
    99106then
    100    echo "No output files written! Something went wrong... -> aborting"
     107   echo "No output files written! Something went wrong... -> aborting" >> $logfile 2>&1
    101108   exit
    102109fi
    103110
    104 echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now."
     111echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now." >> $logfile 2>&1
    105112
    106113# check for differences in the checksums
     
    109116if [ "$output" = "" ]
    110117then
    111    echo "All checksums are identical!"
     118   echo "All checksums are identical." >> $logfile 2>&1
    112119   muxschk=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw ${checkpath}/tape_${id}.md5.wue | wc -l`
    113120   if [ $muxslog == $muxschk ]
    114121   then
    115       echo "Number of checked files matches. Launching movingrawfiles now. (to be included)" | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
     122      echo "Number of checked files matches. Files are ready." >> $logfile 2>&1
    116123   else
    117       echo "Number of checked files doesn't match number of extracted files. Something went wrong..." | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
     124      echo "Number of checked files doesn't match number of extracted files. Something went wrong..." >> $logfile 2>&1
    118125   fi
    119126else
    120    echo -e "The files are not identical! diff found the following differences:\n$output"
     127   echo -e "The files are not identical! diff found the following differences:\n$output" >> $logfile 2>&1
    121128fi
    122129
    123 echo "program terminated."
     130echo "Program terminated." >> $logfile 2>&1
  • trunk/MagicSoft/Mars/datacenter/scripts/runstar

    r9086 r9136  
    7575
    7676echo "staging files..." >> $scriptlog 2>&1
    77 ssh -nx phoenix /opt/SUNWsamfs/bin/stage -V $inpath/20*_0*${run}_Y_*_E.root >> $scriptlog 2>&1
     77ssh -nx phoenix /opt/SUNWsamfs/bin/stage -V $inpath/20[01][0-9]*_0*${run}_Y_*.root >> $scriptlog 2>&1
    7878
    79 echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
    80 ./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null
     79
     80# define star.rc files
     81starrcnew=$setuppath/$program/star.rc
     82starrcmux=$setuppath/$program/star_mux.rc
     83# link star.rc file
     84echo "linking the star.rc file to $outpath" >> $scriptlog 2>&1
     85if [ $sequence -gt 200000 ]
     86then
     87   ln -vsf $starrcmux $outpath/star.rc >> $scriptlog 2>&1
     88else
     89   ln -vsf $starrcnew $outpath/star.rc >> $scriptlog 2>&1
     90fi
     91starrcseq=$outpath/star.rc
     92
     93echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
     94./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null
    8195check1=$?
    8296
Note: See TracChangeset for help on using the changeset viewer.