Changeset 19425 for trunk/DataCheck


Ignore:
Timestamp:
01/11/19 23:38:53 (6 years ago)
Author:
Daniela Dorner
Message:
print schedule to cron email if a source is found, add only to schedule if observation is during this night (previously only dates were grepped)
File:
1 edited

Legend:

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

    r19400 r19425  
    5454   schedulefile2=$schedulepath/swift.schedule.formated
    5555   schedulefile3=$schedulepath/swift.schedule.txt
     56   schedulefile4=$schedulepath/swift.schedule-cut.txt
    5657   
    5758   # overwrite already existing file
     
    9899   for (( i=0; i<${#sources[@]}; i++ ))
    99100   do
    100       grep "${sources[$i]}" $schedulefile2 >>$schedulefile3
     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
    101119   done
    102120   
     
    106124   then
    107125      echo -e "\nNone of the sources was found in the Swift schedule." >> $schedulefile3
     126   else
     127      echo -n $date": " && cat $schedulefile3 | grep -v Searched
    108128   fi
    109129
Note: See TracChangeset for help on using the changeset viewer.