Index: trunk/DataCheck/Transfer/RsyncRawToISDC.sh
===================================================================
--- trunk/DataCheck/Transfer/RsyncRawToISDC.sh	(revision 13079)
+++ trunk/DataCheck/Transfer/RsyncRawToISDC.sh	(revision 13082)
@@ -19,5 +19,4 @@
 # get todo list
 gettodo 
-
 
 for (( s=0 ; s < $num ; s++ ))
@@ -44,14 +43,19 @@
    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
+           if ! [ -L $ingestlink ]
+           then 
+              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
+           else
+              printprocesslog "INFO link "$ingestlink" already existing."
+           fi
            ;;
       *)   printprocesslog "WARN "$rawfilelp" could not be transferred to ISDC."
@@ -60,4 +64,40 @@
    esac
    
+   query="SELECT fHasDrsFile from RunInfo WHERE fNight="$night" AND fRunID="$runid
+   numdrs=`sendquery`
+   if [ $numdrs -gt 0 ]
+   then 
+      drsfilelp="/loc_data/zipraw/./"$nightpath"/"$night"_"`printf %03d $runid`".drs.fits.gz"
+      drsfileisdc=$rawdirisdc$nightpath"/"$night"_"`printf %03d $runid`".drs.fits.gz"
+      drsingestlink=$ingestlinkpath"/"$night"_"`printf %03d $runid`".drs.fits.gz"
+      printprocesslog "INFO rsync drsfile "$drsfilelp" to ISDC "$rawdirisdc
+      echo "INFO rsync drsfile "$drsfilelp" 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 -T $rsynctempdir --partial --stats fact@161.72.93.131:$drsfilelp $rawdirisdc >> $logfile 2>&1
+      check3=$?
+
+      case $check3 in
+         0)   printprocesslog "INFO drsfile "$drsfilelp" transferred successfully to ISDC."
+              if ! [ -L $drsingestlink ]
+              then 
+                 printprocesslog "INFO create link for "$drsfileisdc
+                 ln -sv $drsfileisdc $drsingestlink >> $logfile 2>&1
+                 check4=$?
+                 case $check4 in
+                    0)   printprocesslog "INFO link for  "$drsfileisdc" created successfully."
+                         ;;
+                    *)   printprocesslog "WARN link for "$drsfileisdc" could not be created."
+                         check=$check4
+                         ;;
+                 esac
+              else
+                 printprocesslog "INFO link "$drsingestlink" already existing."
+              fi
+              ;;
+         *)   printprocesslog "WARN "$drsfilelp" could not be transferred to ISDC."
+              check=$check3
+              ;;
+      esac
+   fi
 
    setstatus "stop" 
