Changeset 19481


Ignore:
Timestamp:
Apr 2, 2019, 10:27:09 PM (3 months ago)
Author:
dorner
Message:
implemented start/stop date, improved logging
File:
1 edited

Legend:

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

    r19480 r19481  
    11#!/bin/bash
    22#
    3 # Script to copy scheduling plots and suggested schedule to the web
     3# Script to print FACT schedule
    44#
    5 
    6 # remarks:
    7 #
    8 # be aware that the script only writes files which don't exist yet
    9 # i.e. in case of a new sw version, old files have to be deleted or moved away
    10 # you can also delete only the txt-files with the suggested schedule
    11 #
    12 # script to be executed on gate, i.e. FACT++ there has to be up-to-date
    13 
    14 # create plots for past (-) / future (+) night
    15 directions=( "-" "+" )
     5# Remarks:
     6#   make sure to use right setup for makeschedule
     7#   make sure that numdays is large enough to cover
     8#     from start to end
    169
    1710# number of days to be treated
     
    1912#numdays=7
    2013
    21 schedulefile=/home/dorner/FACT-Schedule-for-XMM.txt
    22 mrk421file=/home/dorner/FACT-Schedule-Mrk421.txt
    23 mrk501file=/home/dorner/FACT-Schedule-Mrk501.txt
    24 mrk1959file=/home/dorner/FACT-Schedule-1959.txt
     14# time range
     15start=20200101
     16end=20201231
     17
     18
     19# for XMM Newton
     20schedulefile=/home/dorner/FACT.schedule/for.XMM/FACT-Schedule-for-XMM.txt
     21mrk421file=/home/dorner/FACT.schedule/for.XMM/FACT-Schedule-Mrk421.txt
     22mrk501file=/home/dorner/FACT.schedule/for.XMM/FACT-Schedule-Mrk501.txt
     23mrk1959file=/home/dorner/FACT.schedule/for.XMM/FACT-Schedule-1959.txt
     24# for INTEGRAL proposal
     25schedulefile=/home/dorner/FACT.schedule/for.INTEGRAL.proposal/FACT-Schedule-for-XMM.txt
     26mrk421file=/home/dorner/FACT.schedule/for.INTEGRAL.proposal/FACT-Schedule-Mrk421.txt
     27mrk501file=/home/dorner/FACT.schedule/for.INTEGRAL.proposal/FACT-Schedule-Mrk501.txt
     28mrk1959file=/home/dorner/FACT.schedule/for.INTEGRAL.proposal/FACT-Schedule-1959.txt
    2529
    2630#exit
    2731
    2832# filling file
    29 echo "# FACT Schedule from 2019-01-01 till 2020-12-31" > $schedulefile
     33echo "# FACT Schedule from "`date --date="$start" +%Y-%m-%d`" till " `date --date="$end" +%Y-%m-%d` > $schedulefile
     34echo "# FACT Schedule from "`date --date="$start" +%Y-%m-%d`" till " `date --date="$end" +%Y-%m-%d`
    3035
    3136# creating files for $numdays days (if they don't exist yet)
    3237for (( i=0; i < $numdays ; i++))
    3338do
    34    date=`date --date="20190101+${i}days" +%Y-%m-%d`
    35    date2=`date --date="20190101+${i}days" +%Y%m%d`
    36    echo $date
     39   date=`date --date="$start+${i}days" +%Y-%m-%d`
     40   date2=`date --date="$start+${i}days" +%Y%m%d`
     41   if [ $date2 -gt $end ]
     42   then
     43      continue
     44   fi
    3745   #num=`~/SW/FACT++.2019.01.01/build/makeschedule $date 2>/dev/null | tail -9 | grep ^201 | grep -c SHUTDOWN`
    3846   ~/SW/FACT++.2019.01.01/build/makeschedule $date 2>/dev/null | sed -e '1,/SHUTDOWN/d' | grep ^20[12][0-9] >> $schedulefile
Note: See TracChangeset for help on using the changeset viewer.