source: trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum@ 8560

Last change on this file since 8560 was 8517, checked in by snruegam, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2echo "Please specify the tape number (e.g. 3MG005L3)."
3read no
4echo "Thank you. Your query is being processed. This may take some time."
5
6checkpath=/home/lapalma/tapecont/cont/muxdata/checksums
7file=/home/lapalma/tapecont/cont/muxdata/tape_${no}.md5
8if [ ! -f $file ]
9then
10 echo "tape $file not found."
11 exit
12fi
13
14date | tee ${checkpath}/tape_${no}.md5.lapalma | tee ${checkpath}/tape_${no}.md5.wue
15
16# read the tapecont file line by line
17while read line
18do
19 muxchk=`echo $line | cut -d/ -f1`
20 # only check muxdata, not cc-, caco- or drivelog-files
21 if [ "$muxchk" = "muxdata" ]
22 then
23 sum=($line)
24 # reformat the files and checksums correctly and compare them
25 echo "${sum[1]} ${sum[0]}" >> ${checkpath}/tape_${no}.md5.lapalma
26
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.wue
28 #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${no}.md5.wue
29 fi
30done < $file
31
32date | tee -a ${checkpath}/tape_${no}.md5.lapalma | tee -a ${checkpath}/tape_${no}.md5.wue
33
34if [ ! -f ${checkpath}/tape_${no}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${no}.md5.wue ]
35then
36 echo "No output files written! Something went wrong..."
37 exit
38fi
39
40echo "Wrote checksums to ${checkpath}/tape_${no}.md5.lapalma and ${checkpath}/tape_${no}.md5.wue. Comparing now."
41
42
43# check for differences in the checksums
44output=`diff ${checkpath}/tape_${no}.md5.lapalma ${checkpath}/tape_${no}.md5.wue`
45
46if [ "$output" = "" ]
47then
48 echo "All checksums are ok!"
49else
50 echo -e "The files are not identical! diff found the following differences:\n$output"
51fi
52
53echo "program terminated."
Note: See TracBrowser for help on using the repository browser.