Ignore:
Timestamp:
09/16/08 11:20:26 (16 years ago)
Author:
snruegam
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.