Last change
on this file since 13389 was 13285, checked in by Daniela Dorner, 13 years ago |
give only warning if files older than some days are missing
|
-
Property svn:executable
set to
*
|
File size:
1.7 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 | #
|
---|
3 |
|
---|
4 | source `dirname $0`/../Sourcefile.sh
|
---|
5 | printprocesslog "INFO starting $0"
|
---|
6 | program=CheckAuxFilesAvail
|
---|
7 | step=AuxFilesAvailISDC
|
---|
8 | transferdelay=3 #days
|
---|
9 |
|
---|
10 | set -C
|
---|
11 |
|
---|
12 | # check if script is already running
|
---|
13 | lockfile=$lockpath/lock-$program.txt
|
---|
14 | checklock
|
---|
15 |
|
---|
16 | # get todo list
|
---|
17 | gettodo
|
---|
18 |
|
---|
19 |
|
---|
20 | for (( s=0 ; s < $num ; s++ ))
|
---|
21 | do
|
---|
22 | night=${primaries[$s]}
|
---|
23 | currentnight=`date +%Y%m%d`
|
---|
24 | checknight=`echo " $currentnight - $transferdelay " | bc -l`
|
---|
25 |
|
---|
26 | setstatus "start"
|
---|
27 |
|
---|
28 | auxpath=$auxdata"/"`echo $night | cut -c 1-4`/`echo $night | cut -c 5-6`/`echo $night | cut -c 7-8`
|
---|
29 | drivefile=$auxpath/$night".DRIVE_CONTROL_TRACKING_POSITION.fits"
|
---|
30 | weatherfile=$auxpath/$night".MAGIC_WEATHER_DATA.fits"
|
---|
31 | ratesfile=$auxpath/$night".FTM_CONTROL_TRIGGER_RATES.fits"
|
---|
32 | temperaturefile=$auxpath/$night".FSC_CONTROL_TEMPERATURE.fits"
|
---|
33 | humidityfile=$auxpath/$night".FSC_CONTROL_HUMIDITY.fits"
|
---|
34 |
|
---|
35 | test -e $drivefile
|
---|
36 | check1=$?
|
---|
37 | test -e $weatherfile
|
---|
38 | check2=$?
|
---|
39 | test -e $ratesfile
|
---|
40 | check3=$?
|
---|
41 | test -e $temperaturefile
|
---|
42 | check4=$?
|
---|
43 | test -e $humidityfile
|
---|
44 | check5=$?
|
---|
45 |
|
---|
46 | totalcheck=`echo $check1 + $check2 + $check3 + $check4 + $check5 | bc -l`
|
---|
47 | totalcheck2=${check1}${check2}${check3}${check4}${check5}
|
---|
48 |
|
---|
49 | case $totalcheck in
|
---|
50 | 0) printprocesslog "INFO found auxfiles for night "$night"."
|
---|
51 | ;;
|
---|
52 | *) if [ $night -lt $checknight ]
|
---|
53 | then
|
---|
54 | printprocesslog "WARN "$totalcheck" auxiliary files missing ("$totalcheck2") for night "$night"."
|
---|
55 | check=$totalcheck2
|
---|
56 | else
|
---|
57 | check="no"
|
---|
58 | printprocesslog "INFO "$totalcheck" auxiliary files missing ("$totalcheck2") for night "$night"."
|
---|
59 | fi
|
---|
60 | ;;
|
---|
61 | esac
|
---|
62 |
|
---|
63 | setstatus "stop"
|
---|
64 | done
|
---|
65 |
|
---|
66 | finish
|
---|
67 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.