source: trunk/DataCheck/DataCheck/SchedulingPlots.sh @ 18660

Last change on this file since 18660 was 18660, checked in by dorner, 3 years ago
udated path to makeschedule
  • 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=2000
19
20mindate=20111101
21maxdate=20191231
22
23plot=/home/fact/FACT++/makeplots
24#schedule=/users/fact/operation/makeschedule
25schedule=/home/fact/FACT++.dbg/makeschedule
26#root=/opt/root_v5.34.10/bin/thisroot.sh
27
28# creating files for $numdays days (if they don't exist yet)
29for (( i=0; i < $numdays ; i++))
30do 
31   for direction in ${directions[@]}
32   do
33      outpath=/home/factwww/scheduling/`date --date="${direction}${i}days" +%Y/%m/%d`
34      date=`date --date="${direction}${i}days" +%Y-%m-%d`
35      date2=`date --date="${direction}${i}days" +%Y%m%d`
36      schedfile=$outpath"/schedule-"$date2".txt"
37     
38      if [ $date2 -gt $maxdate ] || [ $date2 -lt $mindate ]
39      then
40          continue
41      fi
42      echo -n $date
43      if ! [ -d $outpath ]
44      then
45         mkdir -p $outpath
46      else
47         if ! [ -e $schedfile ]
48         then 
49            echo -n " creating "$schedfile"..."
50            #echo "$schedule --config /home/fact/makeschedule_gate.rc --date $date >$schedfile 2>/dev/null"
51            $schedule --config /home/fact/makeschedule_gate.rc --date $date >$schedfile 2>/dev/null
52         else
53            echo -n " "$outpath" already done -> continue"
54         fi
55         echo ""
56         continue 
57      fi
58      echo -n ": creating files..."
59      cd $outpath
60      $plot $date --max-zd=75 --max-current=90 >/dev/null 2>&1
61      files=`ls *.eps`
62      for file in $files
63      do 
64         if ls $file | grep Legend >/dev/null
65         then
66            scale=0.8
67         else
68            scale=1.5
69         fi
70         pstoimg -quiet -scale $scale $file
71      done
72      echo -n "creating "$schedfile" ..."
73      $schedule --config /home/fact/makeschedule_gate.rc --date $date >$schedfile 2>/dev/null
74      echo ""
75   done
76done
Note: See TracBrowser for help on using the repository browser.