source: trunk/DataCheck/Transfer/RsyncRawToISDC.sh@ 13053

Last change on this file since 13053 was 13053, checked in by Daniela Dorner, 13 years ago
added (scripts for transfer from LP to ISDC)
  • Property svn:executable set to *
File size: 2.0 KB
Line 
1#!/bin/sh
2#
3
4source `dirname $0`/../Sourcefile.sh
5printprocesslog "INFO starting $0"
6program=RsyncRawToISDC
7step=RawFileRsyncedISDC
8pwfile=/home_nfs/isdc/fact_opr/rsync.pwd
9
10set -C
11
12logfile=$runlogpath"/RsyncRawToISDC-"$datetime".log"
13date >> $logfile 2>&1
14
15# check if script is already running
16lockfile=$lockpath/lock-$program.txt
17checklock
18
19# get todo list
20gettodo
21
22
23for (( s=0 ; s < $num ; s++ ))
24do
25 night=${primaries[$s+$s]}
26 runid=${primaries[$s+$s+1]}
27 nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
28
29 setstatus "start"
30
31 rawfilelp="/loc_data/zipraw/./"$nightpath"/"$night"_"`printf %03d $runid`".fits.gz"
32 rawdirisdc="/scratch/from_lapalma/raw/"
33 rawfileisdc=$rawdirisdc$nightpath"/"$night"_"`printf %03d $runid`".fits.gz"
34 ingestlinkpath="/scratch/ingest_links/raw/"$nightpath
35 makedir $ingestlinkpath >> $logfile 2>&1
36 ingestlink=$ingestlinkpath"/"$night"_"`printf %03d $runid`".fits.gz"
37
38 printprocesslog "INFO rsync rawfile "$rawfilelp" to ISDC "$rawdirisdc
39 echo "INFO rsync rawfile "$rawfilelp" to ISDC "$rawdirisdc >> $logfile 2>&1
40 #rsync -rltDvR --partial --stats --password-file=$pwfile factdata@161.72.93.131::$rawfilelp $rawdirisdc >> $logfile 2>&1
41 rsync -rltDvR --partial --stats fact@161.72.93.131:$rawfilelp $rawdirisdc >> $logfile 2>&1
42 check1=$?
43
44 case $check1 in
45 0) printprocesslog "INFO rawfile "$rawfilelp" transferred successfully to ISDC."
46 printprocesslog "INFO create link for "$rawfileisdc
47 ln -sv $rawfileisdc $ingestlink >> $logfile 2>&1
48 check2=$?
49 case $check2 in
50 0) printprocesslog "INFO link for "$rawfileisdc" created successfully."
51 ;;
52 *) printprocesslog "WARN link for "$rawfileisdc" could not be created."
53 check=$check2
54 ;;
55 esac
56 ;;
57 *) printprocesslog "WARN "$rawfilelp" could not be transferred to ISDC."
58 check=$check1
59 ;;
60 esac
61
62
63 setstatus "stop"
64done
65
66finish
67
Note: See TracBrowser for help on using the repository browser.