|
Last change
on this file since 16320 was 13309, checked in by Daniela Dorner, 14 years ago |
|
added check for /archive/fact/fails/raw
|
-
Property svn:executable
set to
*
|
|
File size:
1.6 KB
|
| Line | |
|---|
| 1 | #!/bin/bash
|
|---|
| 2 | #
|
|---|
| 3 |
|
|---|
| 4 | source `dirname $0`/../Sourcefile.sh
|
|---|
| 5 | printprocesslog "INFO starting $0"
|
|---|
| 6 | program=CheckRawFilesAvail
|
|---|
| 7 | step=RawFileAvailISDC
|
|---|
| 8 | transferdelay=3 #days
|
|---|
| 9 | failsdir=/archive/fact/fails/raw
|
|---|
| 10 |
|
|---|
| 11 | set -C
|
|---|
| 12 |
|
|---|
| 13 | # check if script is already running
|
|---|
| 14 | lockfile=$lockpath/lock-$program.txt
|
|---|
| 15 | checklock
|
|---|
| 16 |
|
|---|
| 17 | # get todo list
|
|---|
| 18 | gettodo
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 | for (( s=0 ; s < $num ; s++ ))
|
|---|
| 22 | do
|
|---|
| 23 | night=${primaries[$s+$s]}
|
|---|
| 24 | runid=${primaries[$s+$s+1]}
|
|---|
| 25 | currentnight=`date +%Y%m%d`
|
|---|
| 26 | checknight=`echo " $currentnight - $transferdelay " | bc -l`
|
|---|
| 27 |
|
|---|
| 28 | setstatus "start"
|
|---|
| 29 |
|
|---|
| 30 | night2=`echo $night | cut -c 1-4`/`echo $night | cut -c 5-6`/`echo $night | cut -c 7-8`
|
|---|
| 31 | rawfile=$rawdata/$night2/$night"_"`printf %03d $runid`".fits.gz"
|
|---|
| 32 | failsfile=$failsdir/$night2/$night"_"`printf %03d $runid`".fits.gz"
|
|---|
| 33 | test -e $rawfile
|
|---|
| 34 | check1=$?
|
|---|
| 35 |
|
|---|
| 36 | case $check1 in
|
|---|
| 37 | 0) printprocesslog "INFO found rawfile "$rawfile
|
|---|
| 38 | ;;
|
|---|
| 39 | *) test -e $failsfile
|
|---|
| 40 | check2=$?
|
|---|
| 41 |
|
|---|
| 42 | case $check2 in
|
|---|
| 43 | 0) printprocesslog "INFO found rawfile in "$failsfile
|
|---|
| 44 | # raw file is not in archive for files which are ok
|
|---|
| 45 | check=$check2
|
|---|
| 46 | ;;
|
|---|
| 47 | *) # print warning only for files which are older than $transferdelay days
|
|---|
| 48 | if [ $night -lt $checknight ]
|
|---|
| 49 | then
|
|---|
| 50 | printprocesslog "WARN "$rawfile" and "$failsfile" missing."
|
|---|
| 51 | else
|
|---|
| 52 | printprocesslog "INFO "$rawfile" and "$failsfile" missing."
|
|---|
| 53 | fi
|
|---|
| 54 | check="no"
|
|---|
| 55 | ;;
|
|---|
| 56 | esac
|
|---|
| 57 | ;;
|
|---|
| 58 | esac
|
|---|
| 59 |
|
|---|
| 60 | setstatus "stop"
|
|---|
| 61 | done
|
|---|
| 62 |
|
|---|
| 63 | finish
|
|---|
| 64 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.