Index: trunk/DataCheck/Transfer/RsyncAuxToISDC.sh
===================================================================
--- trunk/DataCheck/Transfer/RsyncAuxToISDC.sh	(revision 13053)
+++ trunk/DataCheck/Transfer/RsyncAuxToISDC.sh	(revision 13053)
@@ -0,0 +1,56 @@
+#!/bin/bash
+
+# this script has been written to run on La Palma on the machine data
+#   i.e. paths are only working on this machine
+
+source `dirname $0`/../Sourcefile.sh
+printprocesslog "INFO starting "$0
+
+logfile=$runlogpath"/RsyncAuxToISDC-"$datetime".log"
+date >> $logfile
+
+# get last 3 nights
+dates=( `date +%Y/%m/%d --date="-12hour"` `date +%Y/%m/%d --date="-36hour"` `date +%Y/%m/%d --date="-60hour"` )
+
+# do rsync for rawfiles of these dates
+for date in ${dates[@]}
+do 
+   echo "" >> $logfile 2>&1
+   echo $date
+   # auxiliary data directories
+   auxdirlp=/loc_data/aux/./$date/ 
+   auxdirisdc=/scratch/from_lapalma/aux
+   
+   printprocesslog "INFO processing files in "$auxdirlp >> $logfile 2>&1
+   echo `date`": processing files in "$auxdirlp >> $logfile 2>&1
+   
+   # get current hour
+   hour=`date +%k`
+   # define bwlimit for rsync depending on the time: from 19-7h reduced bwlimit for rsync
+   if [ $hour -le 14 ] || [ $hour -ge 13 ]
+   then
+      # use once a day the -c option
+      #   normally files are compared by size and time
+      #   but for the daily files the size doesn't change when TSTOP is added
+      #   due to the one hour time difference it could happen that rsync
+      #     doesn't update the file when only checking time and size
+      # run with this option after lunch (LP time)
+      option="-c"
+      printprocesslog "INFO rsync data with option "$option >> $logfile 2>&1
+      echo "rsync data with option "$option >> $logfile 2>&1
+   else 
+      # no extra option
+      printprocesslog "INFO rsync data without extra option" >> $logfile 2>&1
+      echo "rsync data without extra option" >> $logfile 2>&1
+   fi
+   
+   #rsync from daq to data
+   #if ! /usr/bin/rsync -avxHPu $bwlimit $auxdirdaq $auxdirdata >> $logfile 2>&1 # in case of adding checksum, only update files with rsync
+   if ! rsync -rltDvR --stats fact@161.72.93.131:$auxdirlp $auxdirisdc >> $logfile 2>&1
+   then
+      printprocesslog "WARN problem rsyncing auxiliary data for "$date" from La Palma to ISDC"
+      echo `date`": problem rsyncing auxiliary data for "$date" from La Palma to ISDC" >> $logfile 2>&1
+      echo `date`": problem rsyncing auxiliary data for "$date" from La Palma to ISDC"
+   fi
+done
+
Index: trunk/DataCheck/Transfer/RsyncRawToISDC.sh
===================================================================
--- trunk/DataCheck/Transfer/RsyncRawToISDC.sh	(revision 13053)
+++ trunk/DataCheck/Transfer/RsyncRawToISDC.sh	(revision 13053)
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+
+source `dirname $0`/../Sourcefile.sh
+printprocesslog "INFO starting $0"
+program=RsyncRawToISDC
+step=RawFileRsyncedISDC
+pwfile=/home_nfs/isdc/fact_opr/rsync.pwd
+
+set -C
+
+logfile=$runlogpath"/RsyncRawToISDC-"$datetime".log"
+date >> $logfile 2>&1
+
+# check if script is already running
+lockfile=$lockpath/lock-$program.txt
+checklock 
+
+# get todo list
+gettodo 
+
+
+for (( s=0 ; s < $num ; s++ ))
+do
+   night=${primaries[$s+$s]}
+   runid=${primaries[$s+$s+1]}
+   nightpath=`echo $night | cut -c 1-4`"/"`echo $night | cut -c 5-6`"/"`echo $night | cut -c 7-8`
+   
+   setstatus "start" 
+
+   rawfilelp="/loc_data/zipraw/./"$nightpath"/"$night"_"`printf %03d $runid`".fits.gz"
+   rawdirisdc="/scratch/from_lapalma/raw/"
+   rawfileisdc=$rawdirisdc$nightpath"/"$night"_"`printf %03d $runid`".fits.gz"
+   ingestlinkpath="/scratch/ingest_links/raw/"$nightpath
+   makedir $ingestlinkpath >> $logfile 2>&1
+   ingestlink=$ingestlinkpath"/"$night"_"`printf %03d $runid`".fits.gz"
+
+   printprocesslog "INFO rsync rawfile "$rawfilelp" to ISDC "$rawdirisdc
+   echo "INFO rsync rawfile "$rawfilelp" to ISDC "$rawdirisdc >> $logfile 2>&1
+   #rsync -rltDvR --partial --stats --password-file=$pwfile factdata@161.72.93.131::$rawfilelp $rawdirisdc >> $logfile 2>&1
+   rsync -rltDvR --partial --stats fact@161.72.93.131:$rawfilelp $rawdirisdc >> $logfile 2>&1
+   check1=$?
+
+   case $check1 in
+      0)   printprocesslog "INFO rawfile "$rawfilelp" transferred successfully to ISDC."
+           printprocesslog "INFO create link for "$rawfileisdc
+           ln -sv $rawfileisdc $ingestlink >> $logfile 2>&1
+           check2=$?
+           case $check2 in
+              0)   printprocesslog "INFO link for  "$rawfileisdc" created successfully."
+                   ;;
+              *)   printprocesslog "WARN link for "$rawfileisdc" could not be created."
+                   check=$check2
+                   ;;
+           esac
+           ;;
+      *)   printprocesslog "WARN "$rawfilelp" could not be transferred to ISDC."
+           check=$check1
+           ;;
+   esac
+   
+
+   setstatus "stop" 
+done
+
+finish 
+
