source: trunk/DataCheck/Tools/print_schedule.sh @ 19480

Last change on this file since 19480 was 19480, checked in by dorner, 7 weeks ago
added (script to print FACT schedule)
  • Property svn:executable set to *
File size: 2.2 KB
Line 
1#!/bin/bash
2#
3# Script to copy scheduling plots and suggested schedule to the web
4#
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
15directions=( "-" "+" )
16
17# number of days to be treated
18numdays=731
19#numdays=7
20
21schedulefile=/home/dorner/FACT-Schedule-for-XMM.txt
22mrk421file=/home/dorner/FACT-Schedule-Mrk421.txt
23mrk501file=/home/dorner/FACT-Schedule-Mrk501.txt
24mrk1959file=/home/dorner/FACT-Schedule-1959.txt
25
26#exit
27
28# filling file
29echo "# FACT Schedule from 2019-01-01 till 2020-12-31" > $schedulefile
30
31# creating files for $numdays days (if they don't exist yet)
32for (( i=0; i < $numdays ; i++))
33do 
34   date=`date --date="20190101+${i}days" +%Y-%m-%d`
35   date2=`date --date="20190101+${i}days" +%Y%m%d`
36   echo $date
37   #num=`~/SW/FACT++.2019.01.01/build/makeschedule $date 2>/dev/null | tail -9 | grep ^201 | grep -c SHUTDOWN`
38   ~/SW/FACT++.2019.01.01/build/makeschedule $date 2>/dev/null | sed -e '1,/SHUTDOWN/d' | grep ^20[12][0-9] >> $schedulefile
39   #echo ""
40done
41
42text=`cat $schedulefile`
43echo $text | grep -E -o "20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] Mrk 421 \[[0-9]{2,3}'; [0-9]{1,2}.[0-9]\/[0-9]{1,2}.[0-9]\] 20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]" | awk ' { print $1 " " $2 " - " $7 " " $8 " " $5 } ' | sed -e 's/;/]/' > $mrk421file
44echo $text | grep -E -o "20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] Mrk 501 \[[0-9]{2,3}'; [0-9]{1,2}.[0-9]\/[0-9]{1,2}.[0-9]\] 20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]" | awk ' { print $1 " " $2 " - " $7 " " $8 " " $5 } ' | sed -e 's/;/]/' > $mrk501file
45echo $text | grep -E -o "20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9] 1ES 1959\+650 \[[0-9]{2,3}'; [0-9]{1,2}.[0-9]\/[0-9]{1,2}.[0-9]\] 20[12][0-9]-[0-2][0-9]-[0-3][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]" | awk ' { print $1 " " $2 " - " $7 " " $8 " " $5 } ' | sed -e 's/;/]/' > $mrk1959file
46
Note: See TracBrowser for help on using the repository browser.