Ignore:
Timestamp:
10/14/06 19:16:21 (18 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/dbchk

    r8057 r8065  
    66# directory where the sequence files are stored
    77sequencedir=/magic/sequences
     8callistodir=/magic/data/callisto
     9stardir=/magic/data/star
    810# access to the sql database
    911alias mymysql='mysql -s -u MAGIC -h hercules --password=d99swMT!'
     
    1719# Cross check sequences in Sequence and other databases
    1820# 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+ ?
    1923
    2024
    2125# CHECK 1
    22 echo Checking if all sequences in Sequences have a corresponding sequence files
     26echo Checking if all sequence files have a corresponding entry in Sequences
    2327files=`find $sequencedir -type f`
    2428for file in $files
     
    2731   if [ "$sequence" = "" ]
    2832   then
    29       echo No sequence file: $sequence
     33      echo No sequence file: $file
    3034      continue
    3135   fi
     
    3438   if ! [ "$sequence" = "$var" ]
    3539   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
     43done
     44
     45# CHECK 1b (callisto)
     46echo Checking if all sequences in $callistodir have a corresponding sequence in Sequence
     47dirs=`find $callistodir -type d`
     48for dir in $dirs
     49do
     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
     63done
     64
     65# CHECK 1c (star)
     66echo Checking if all sequences in $stardir have a corresponding sequence in Sequence
     67dirs=`find $stardir -type d`
     68for dir in $dirs
     69do
     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.
    3781      continue
    3882   fi
     
    4084
    4185# CHECK 2
    42 echo Checking if all sequence files have a corresponding entry in Sequences
     86echo Checking if all sequences in Sequences have a corresponding sequence files
    4387sequences=`echo SELECT fSequenceFirst FROM $db.Sequences | mymysql`
    4488for sequence in $sequences
    4589do
    46    var=`find $sequencedir -regex .*/sequence0+${sequence}\.txt$`
     90   var=`find $sequencedir -type f -regex .*/sequence0+${sequence}\.txt$`
    4791   if [ "$var" = "" ]
    4892   then
Note: See TracChangeset for help on using the changeset viewer.