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

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