Changeset 9136 for trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
- Timestamp:
- 09/16/08 11:20:26 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
r9114 r9136 30 30 # transferred together with the logfile. 31 31 # 32 # The script will be automised by being executed after reading tapes with33 # the not-yet finished script readlapalmatapes. At the moment it is being34 # executed by hand.35 #36 32 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." 33 no=$@ 34 if [ "$no" == "" ] 35 then 36 echo "no tape specified -> aborting" 37 exit 38 fi 40 39 41 40 checkpath=/home/lapalma/tapecont/cont/muxdata/checksums … … 43 42 L=`echo $file | cut -c49` 44 43 id=${no}L${L} 44 logfile=${checkpath}/tape_${id}.log 45 45 46 46 if [ ! -f $file ] 47 47 then 48 echo "tape $file not found -> aborting" 48 echo "tape $file not found -> aborting" >> $logfile 2>&1 49 49 exit 50 50 fi … … 52 52 if [ -f ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ] 53 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 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 63 fi 64 65 if [ "`cat $file`" == "" ] 66 then 67 echo "$file is empty, the checksums are missing -> aborting" >> $logfile 2>&1 68 exit 61 69 fi 62 70 … … 77 85 if [ ! -f /magic/datacenter/fromtape/${sum[0]} ] && [ ! -f /data/fromtape/${sum[0]} ] 78 86 then 79 echo "File ${sum[0]} does not exist." 87 echo "File ${sum[0]} does not exist." >> $logfile 2>&1 80 88 continue 81 89 fi … … 86 94 if [ ! -f /magic/datacenter/fromtape/${sum[0]} ] 87 95 then 88 ssh -nx phoenixnice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue96 nice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue 89 97 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 92 99 fi 93 100 fi … … 98 105 if [ ! -f ${checkpath}/tape_${id}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${id}.md5.wue ] 99 106 then 100 echo "No output files written! Something went wrong... -> aborting" 107 echo "No output files written! Something went wrong... -> aborting" >> $logfile 2>&1 101 108 exit 102 109 fi 103 110 104 echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now." 111 echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now." >> $logfile 2>&1 105 112 106 113 # check for differences in the checksums … … 109 116 if [ "$output" = "" ] 110 117 then 111 echo "All checksums are identical !"118 echo "All checksums are identical." >> $logfile 2>&1 112 119 muxschk=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw ${checkpath}/tape_${id}.md5.wue | wc -l` 113 120 if [ $muxslog == $muxschk ] 114 121 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.wue122 echo "Number of checked files matches. Files are ready." >> $logfile 2>&1 116 123 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.wue124 echo "Number of checked files doesn't match number of extracted files. Something went wrong..." >> $logfile 2>&1 118 125 fi 119 126 else 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 121 128 fi 122 129 123 echo " program terminated."130 echo "Program terminated." >> $logfile 2>&1
Note:
See TracChangeset
for help on using the changeset viewer.