Changeset 8682 for trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
- Timestamp:
- 08/20/07 13:03:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
r8517 r8682 1 #!/bin/bash 2 echo "Please specify the tape number (e.g. 3MG005L3)." 1 #!/bin/sh 2 # 3 # ======================================================================== 4 # 5 # * 6 # * This file is part of MARS, the MAGIC Analysis and Reconstruction 7 # * Software. It is distributed to you in the hope that it can be a useful 8 # * and timesaving tool in analysing Data of imaging Cerenkov telescopes. 9 # * It is distributed WITHOUT ANY WARRANTY. 10 # * 11 # * Permission to use, copy, modify and distribute this software and its 12 # * documentation for any purpose is hereby granted without fee, 13 # * provided that the above copyright notice appear in all copies and 14 # * that both that copyright notice and this permission notice appear 15 # * in supporting documentation. It is provided "as is" without express 16 # * or implied warranty. 17 # * 18 # 19 # 20 # Author(s): Stefan Ruegamer 05/2007 <mailto:snruegam@astro.uni-wuerzburg.de> 21 # 22 # Copyright: MAGIC Software Development, 2000-2007 23 # 24 # 25 # ======================================================================== 26 # 27 # This script is checking the md5 sums of files read from tape. It 28 # computes the checksums for the extracted files and compares them with 29 # the checksums from La Palma, read out from the md5 sum file which is 30 # transferred together with the logfile. 31 # 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 # 36 37 echo "Please specify the tape number (e.g. 3MG005)." 3 38 read no 4 39 echo "Thank you. Your query is being processed. This may take some time." 5 40 6 41 checkpath=/home/lapalma/tapecont/cont/muxdata/checksums 7 file=/home/lapalma/tapecont/cont/muxdata/tape_${no}.md5 42 file=/home/lapalma/tapecont/cont/muxdata/tape_${no}L*.md5 43 L=`echo $file | cut -c49` 44 id=${no}L${L} 45 8 46 if [ ! -f $file ] 9 47 then 10 echo "tape $file not found ."48 echo "tape $file not found -> aborting" 11 49 exit 12 50 fi 13 51 14 date | tee ${checkpath}/tape_${no}.md5.lapalma | tee ${checkpath}/tape_${no}.md5.wue 52 if [ ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ] 53 then 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 61 fi 62 63 date | tee ${checkpath}/tape_${id}.md5.lapalma | tee ${checkpath}/tape_${id}.md5.wue 15 64 16 65 # read the tapecont file line by line … … 23 72 sum=($line) 24 73 # reformat the files and checksums correctly and compare them 25 echo "${sum[1]} ${sum[0]}" >> ${checkpath}/tape_${ no}.md5.lapalma74 echo "${sum[1]} ${sum[0]}" >> ${checkpath}/tape_${id}.md5.lapalma 26 75 27 ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${ no}.md5.wue28 #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${ no}.md5.wue76 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 77 #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue 29 78 fi 30 79 done < $file 31 80 32 date | tee -a ${checkpath}/tape_${ no}.md5.lapalma | tee -a ${checkpath}/tape_${no}.md5.wue81 date | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue 33 82 34 if [ ! -f ${checkpath}/tape_${ no}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${no}.md5.wue ]83 if [ ! -f ${checkpath}/tape_${id}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${id}.md5.wue ] 35 84 then 36 echo "No output files written! Something went wrong... "85 echo "No output files written! Something went wrong... -> aborting" 37 86 exit 38 87 fi 39 88 40 echo "Wrote checksums to ${checkpath}/tape_${ no}.md5.lapalma and ${checkpath}/tape_${no}.md5.wue. Comparing now."89 echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now." 41 90 42 91 43 92 # check for differences in the checksums 44 output=`diff ${checkpath}/tape_${ no}.md5.lapalma ${checkpath}/tape_${no}.md5.wue`93 output=`diff ${checkpath}/tape_${id}.md5.lapalma ${checkpath}/tape_${id}.md5.wue` 45 94 46 95 if [ "$output" = "" ]
Note:
See TracChangeset
for help on using the changeset viewer.