source: trunk/DataCheck/Processing/CheckRawFilesAvail.sh@ 13286

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