source: trunk/DataCheck/Transfer/BackupRawToWue.sh@ 14444

Last change on this file since 14444 was 13152, checked in by Daniela Dorner, 13 years ago
bugfix for drsfiles
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/bash
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6program=RsyncRawToWue
7step=RawFileAvailWue
8
9set -C
10
11logfile=$runlogpath"/RsyncRawToWue-"$datetime".log"
12date >> $logfile
13
14# check if script is already running
15lockfile=$lockpath/lock-$program.txt
16checklock
17
18# get todo list
19gettodo
20
21
22for (( s=0 ; s < $num ; s++ ))
23do
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"
66done
67
68finish
69
Note: See TracBrowser for help on using the repository browser.