|
Last change
on this file since 13599 was 13152, checked in by Daniela Dorner, 14 years ago |
|
bugfix for drsfiles
|
-
Property svn:executable
set to
*
|
|
File size:
2.0 KB
|
| Line | |
|---|
| 1 | #!/bin/bash
|
|---|
| 2 | #
|
|---|
| 3 |
|
|---|
| 4 | source `dirname $0`/../Sourcefile.sh
|
|---|
| 5 | printprocesslog "INFO starting $0"
|
|---|
| 6 | program=RsyncRawToWue
|
|---|
| 7 | step=RawFileAvailWue
|
|---|
| 8 |
|
|---|
| 9 | set -C
|
|---|
| 10 |
|
|---|
| 11 | logfile=$runlogpath"/RsyncRawToWue-"$datetime".log"
|
|---|
| 12 | date >> $logfile
|
|---|
| 13 |
|
|---|
| 14 | # check if script is already running
|
|---|
| 15 | lockfile=$lockpath/lock-$program.txt
|
|---|
| 16 | checklock
|
|---|
| 17 |
|
|---|
| 18 | # get todo list
|
|---|
| 19 | gettodo
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 | for (( s=0 ; s < $num ; s++ ))
|
|---|
| 23 | do
|
|---|
| 24 | night=${primaries[$s+$s]}
|
|---|
| 25 | runid=${primaries[$s+$s+1]}
|
|---|
| 26 | nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
|
|---|
| 27 |
|
|---|
| 28 | setstatus "start"
|
|---|
| 29 |
|
|---|
| 30 | rawdirisdc="/scratch/from_lapalma/raw"
|
|---|
| 31 | rawfileisdc=$rawdirisdc"/./"$nightpath"/"$night"_"`printf %03d $runid`".fits.gz"
|
|---|
| 32 | rawdirwue="/fact/raw/"
|
|---|
| 33 |
|
|---|
| 34 | printprocesslog "INFO rsync rawfile "$rawfileisdc" to Wue "$rawdirwue
|
|---|
| 35 | #rsync -rltDvR --partial --stats --password-file=/home_nfs/isdc/fact_opr/rsync.pwd factdata@161.72.93.131::$rawfilelp $rawdirisdc >> $logfile 2>&1
|
|---|
| 36 | rsync -avxR --no-p --stats $rawfileisdc operator@coma.astro.uni-wuerzburg.de:$rawdirwue >> $logfile 2>&1
|
|---|
| 37 | check1=$?
|
|---|
| 38 |
|
|---|
| 39 | case $check1 in
|
|---|
| 40 | 0) printprocesslog "INFO rawfile "$rawfileisdc" transferred successfully to Wue."
|
|---|
| 41 | ;;
|
|---|
| 42 | *) printprocesslog "WARN "$rawfileisdc" could not be transferred to Wue."
|
|---|
| 43 | check=$check1
|
|---|
| 44 | ;;
|
|---|
| 45 | esac
|
|---|
| 46 |
|
|---|
| 47 | query="SELECT fHasDrsFile from RunInfo WHERE fNight="$night" AND fRunID="$runid
|
|---|
| 48 | numdrs=`sendquery`
|
|---|
| 49 | if [ $numdrs -gt 0 ]
|
|---|
| 50 | then
|
|---|
| 51 | drsfileisdc=$rawdirisdc"/./"$nightpath"/"$night"_"`printf %03d $runid`".drs.fits.gz"
|
|---|
| 52 | printprocesslog "INFO rsync rawfile "$drsfileisdc" to Wue "$rawdirwue
|
|---|
| 53 | rsync -avxR --no-p --stats $drsfileisdc operator@coma.astro.uni-wuerzburg.de:$rawdirwue >> $logfile 2>&1
|
|---|
| 54 | check1=$?
|
|---|
| 55 |
|
|---|
| 56 | case $check1 in
|
|---|
| 57 | 0) printprocesslog "INFO rawfile "$drsfileisdc" transferred successfully to Wue."
|
|---|
| 58 | ;;
|
|---|
| 59 | *) printprocesslog "WARN "$drsfileisdc" could not be transferred to Wue."
|
|---|
| 60 | check=$check1
|
|---|
| 61 | ;;
|
|---|
| 62 | esac
|
|---|
| 63 | fi
|
|---|
| 64 |
|
|---|
| 65 | setstatus "stop"
|
|---|
| 66 | done
|
|---|
| 67 |
|
|---|
| 68 | finish
|
|---|
| 69 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.