Changeset 19469


Ignore:
Timestamp:
Mar 29, 2019, 2:33:41 PM (3 weeks ago)
Author:
dorner
Message:
fixed bug
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Monitoring/CheckSwiftSchedule.sh

    r19425 r19469  
    6868   #lynx -width 200 -nolist -dump https://www.swift.psu.edu/operations/obsSchedule.php?d=$nextday | grep $nextday >> $schedulefile
    6969   links -width 300 -ssl.certificates 0 -dump https://www.swift.psu.edu/operations/obsSchedule.php?d=$nextday | grep $nextday >> $schedulefile
     70   # fixme: find out why sometimes second day is missing in file (probably just put online late)
    7071
    7172   # check if schedule is empty
     
    7980   # grep only the columns which are needed
    8081   #cat $schedulefile | sed -r -e 's/[0-9]{5,6}[\ ]{1,4}[0-9]{1,3}[\ ]{1,6}//' | grep -o -E '^[\ ]{1,20}20[1-9][0-9]-[01][0-9]-[0-3][0-9]\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\ \ \ 20[1-9][0-9]-[01][0-9]-[0-3][0-9]\ [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\ \ \ [A-Z1-4]([A-Za-z0-9][\ \.\+\-]?){3,20}' > $schedulefile2
    81    cat $schedulefile | awk '{ print $1" "$2" "$3" "$4" "$7" "$8" "$9}' | sed -r -e 's/[-]?[0-9]{1,3}[.][0-9]{5}$//' | sed -r -e 's/[-]?[0-9]{1,3}[.][0-9]{5}\ $//' > $schedulefile2
     82   cat $schedulefile | awk -v d1=$date2 -v d2=$nextday '{ if (($1 ~ d1 && $2 ~ /^18|^19|^20|^21|^22|^23/) || ( $1 ~ d2 && $2 ~ /^0/)) print $1" "$2" "$3" "$4" "$7" "$8" "$9}' | sed -r -e 's/[-]?[0-9]{1,3}[.][0-9]{5}$//' | sed -r -e 's/[-]?[0-9]{1,3}[.][0-9]{5}\ $//' > $schedulefile2
    8283   
    8384   # output list of sources
     
    99100   for (( i=0; i<${#sources[@]}; i++ ))
    100101   do
    101       sourceline=`grep "${sources[$i]}" $schedulefile2`
    102       if [ "$sourceline" = "" ]
    103       then
    104          continue
    105       fi
    106       dat=`echo $sourceline | awk '{ print $1 }' | sed -e 's/-/\//g'`
    107       #echo $dat
    108       hour=`echo $sourceline | awk '{ print $2 }' | awk -F':' '{ print $1 }'`
    109       if [ $hour -gt 12 ] && [ "$dat" != "$date" ]
    110       then
    111          continue
    112       fi
    113       if [ $hour -lt 12 ] && [ "$dat" == "$date" ]
    114       then
    115          continue
    116       fi
    117       #echo "--"$hour"--"
    118       echo $sourceline >>$schedulefile3
     102      grep "${sources[$i]}" $schedulefile2  >>$schedulefile3
    119103   done
    120104   
     
    125109      echo -e "\nNone of the sources was found in the Swift schedule." >> $schedulefile3
    126110   else
    127       echo -n $date": " && cat $schedulefile3 | grep -v Searched
     111      echo "night of "$date": " && cat $schedulefile3 | grep -v Searched | sort
    128112   fi
    129113
Note: See TracChangeset for help on using the changeset viewer.