Changeset 8065 for trunk/MagicSoft/Mars/datacenter/scripts/dbchk
- Timestamp:
- 10/14/06 19:16:21 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/dbchk
r8057 r8065 6 6 # directory where the sequence files are stored 7 7 sequencedir=/magic/sequences 8 callistodir=/magic/data/callisto 9 stardir=/magic/data/star 8 10 # access to the sql database 9 11 alias mymysql='mysql -s -u MAGIC -h hercules --password=d99swMT!' … … 17 19 # Cross check sequences in Sequence and other databases 18 20 # added switch which allows to correct for the problems immediatly 21 # unify the checks (especially 1b and 1c) 22 # for the sequences better use 0* instead of 0+ ? 19 23 20 24 21 25 # CHECK 1 22 echo Checking if all sequence s in Sequences have a corresponding sequence files26 echo Checking if all sequence files have a corresponding entry in Sequences 23 27 files=`find $sequencedir -type f` 24 28 for file in $files … … 27 31 if [ "$sequence" = "" ] 28 32 then 29 echo No sequence file: $ sequence33 echo No sequence file: $file 30 34 continue 31 35 fi … … 34 38 if ! [ "$sequence" = "$var" ] 35 39 then 36 echo Sequence-File $sequence exist but it is not in the db. 40 echo Sequence-File $sequence exist but it is not in Sequences. 41 continue 42 fi 43 done 44 45 # CHECK 1b (callisto) 46 echo Checking if all sequences in $callistodir have a corresponding sequence in Sequence 47 dirs=`find $callistodir -type d` 48 for dir in $dirs 49 do 50 sequence=`echo $file | sed -e "s/^.*\/0\+\([0-9]\+\)$/\1/"` 51 if [ "$sequence" = "" ] 52 then 53 echo Invalid directory: $dir 54 continue 55 fi 56 57 var=`echo SELECT fSequenceFirst FROM $db.Sequences WHERE fSequenceFirst=$sequence | mymysql` 58 if ! [ "$sequence" = "$var" ] 59 then 60 echo $dir exists but no corresponding sequence in Sequences. 61 continue 62 fi 63 done 64 65 # CHECK 1c (star) 66 echo Checking if all sequences in $stardir have a corresponding sequence in Sequence 67 dirs=`find $stardir -type d` 68 for dir in $dirs 69 do 70 sequence=`echo $file | sed -e "s/^.*\/0\+\([0-9]\+\)$/\1/"` 71 if [ "$sequence" = "" ] 72 then 73 echo Invalid directory: $dir 74 continue 75 fi 76 77 var=`echo SELECT fSequenceFirst FROM $db.Sequences WHERE fSequenceFirst=$sequence | mymysql` 78 if ! [ "$sequence" = "$var" ] 79 then 80 echo $dir exists but no corresponding sequence in Sequences. 37 81 continue 38 82 fi … … 40 84 41 85 # CHECK 2 42 echo Checking if all sequence files have a corresponding entry in Sequences86 echo Checking if all sequences in Sequences have a corresponding sequence files 43 87 sequences=`echo SELECT fSequenceFirst FROM $db.Sequences | mymysql` 44 88 for sequence in $sequences 45 89 do 46 var=`find $sequencedir - regex .*/sequence0+${sequence}\.txt$`90 var=`find $sequencedir -type f -regex .*/sequence0+${sequence}\.txt$` 47 91 if [ "$var" = "" ] 48 92 then
Note:
See TracChangeset
for help on using the changeset viewer.