Ignore:
Timestamp:
06/29/18 19:13:37 (6 years ago)
Author:
Daniela Dorner
Message:
added sending email
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/DataCheck/Tools/get_data.sh

    r19043 r19044  
    3535# ToDo (notes DD):
    3636# ----------------
     37# - fix bug for timeunit=timestamp (min-binning)
     38# - add information on souce, binning, etc to data-file
    3739# must-have
    38 # - fix bug for timeunit=timestamp (min-binning)
    39 # - add email sending and return values
    4040# - update function for zd/th-correction
    4141# - update CU for QLA
     
    8080function print_policy()
    8181{
    82     echo "# Data Usage Policy: "
    83     if [ "$expert" == "no" ]
    84     then
    85        echo "#   Using data from the FACT Quick Look Analysis, you agree to cite the FACT design"
    86        echo "#   paper and the quick look analysis website. "
    87        echo "# References: "
    88        echo "#   FACT design paper: http://adsabs.harvard.edu/abs/2013JInst...8P6008A"
    89        echo "#                      http://iopscience.iop.org/1748-0221/8/06/P06008 "
    90        echo "#   FACT Performance Paper: href='http://adsabs.harvard.edu/abs/2014JInst...9P0012B"
    91        echo "#                           href='http://iopscience.iop.org/1748-0221/9/10/P10012"
    92        echo "#   FACT quick look analysis: https://fact-project.org/monitoring"
    93        echo "#                             http://adsabs.harvard.edu/abs/2015arXiv150202582D"
    94        echo "# If you intend to use data or information from this website, please let us know for reference."
    95     else
    96        echo "#   As a member or associated member of the FACT Collaboration, you have access to internal information."
    97        echo "#   Any publication using FACT internal information has to have the full FACT author list."
    98     fi
     82   echo "#"
     83   echo "# Data Usage Policy: "
     84   if [ "$expert" == "no" ]
     85   then
     86      echo "#   Using data from the FACT Quick Look Analysis, you agree to cite the FACT design"
     87      echo "#   paper and the quick look analysis website. "
     88      echo "#"
     89      echo "# References: "
     90      echo "#   FACT design paper: http://adsabs.harvard.edu/abs/2013JInst...8P6008A"
     91      echo "#                      http://iopscience.iop.org/1748-0221/8/06/P06008 "
     92      echo "#   FACT Performance Paper: href='http://adsabs.harvard.edu/abs/2014JInst...9P0012B"
     93      echo "#                           href='http://iopscience.iop.org/1748-0221/9/10/P10012"
     94      echo "#   FACT quick look analysis: https://fact-project.org/monitoring"
     95     echo "#                             http://adsabs.harvard.edu/abs/2015arXiv150202582D"
     96      echo "# If you intend to use data or information from this website, please let us know for reference."
     97   else
     98      echo "#   As a member or associated member of the FACT Collaboration, you have access to internal information."
     99      echo "#   Any publication using FACT internal information has to have the full FACT author list."
     100   fi
     101   echo "#"
    99102}
    100103   
     
    344347      if [ "$overwrite" = "yes" ]
    345348      then
    346          echo "creating "$fileext" ..."
     349         if [ "$mode" != "auto" ]
     350         then
     351            echo "creating "$fileext" ..."
     352         fi
    347353         echo "# This file was created at "`date` > $fileext
    348354         print_policy >> $fileext
     
    362368   if [ "$overwrite" = "yes" ]
    363369   then
    364       echo "creating "$fileint" ..."
     370      if [ "$mode" != "auto" ]
     371      then
     372         echo "creating "$fileint" ..."
     373      fi
    365374      echo "# This file was created at "`date` > $fileint
    366       echo "#" >> $fileint
    367375      print_policy >> $fileint
    368       echo "#" >> $fileint
    369376      echo "# The following query was used: " >> $fileint
    370377      echo "# "$queryint >> $fileint
     
    388395      echo "creating "$filecol" ..."
    389396      echo "# This file was created at "`date` > $filecol
    390       echo "#" >> $filecol
    391397      print_policy >> $filecol
    392       echo "#" >> $filecol
    393398      echo "# The following query was used: " >> $filecol
    394399      echo "# "$querycol >> $filecol
     
    401406   mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -s -e "$querycol" >> $filecol
    402407   #mysql --defaults-file=$sqlpw -u factread --host=$host $dbname -e "$querycol
    403    
    404408}
    405409
     
    412416   overwrite="yes"
    413417   # setup
    414    path=`dirname $0`
    415    datapath=$path"/data"
    416    sqlpw=/home/$USER/.mysql.pw2
     418   datapath="/home/factwww/dch/data"
     419   sqlpw=/home/fact/.mysql.pw
    417420   host=10.0.100.21
    418421   dbname=factdata
     
    421424   source=$3
    422425   bin=$4
     426   if [ "$bin" == "00" ]
     427   then
     428      bin=0
     429   fi
    423430   email=$5
    424431   table=$6
     
    445452   get_results
    446453   
     454   # sending email
    447455   if [ "$expert" == "yes" ]
    448456   then
    449       echo $fileint
     457      cat $fileint | mail -s 'FACT internal data download' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
    450458   else
    451       echo $fileext
    452    fi
    453      
    454    # next: light, dust
    455    # implement all options
    456    # make dch swi
    457    
     459      cat $fileext | mail -s 'FACT data download' -b dorner@astro.uni-wuerzburg.de -r dorner@astro.uni-wuerzburg.de $email
     460   fi
     461     
    458462   exit
    459463fi
Note: See TracChangeset for help on using the changeset viewer.