Index: trunk/MagicSoft/Mars/datacenter/scripts/read_lapalma-tapes
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/read_lapalma-tapes	(revision 9169)
+++ trunk/MagicSoft/Mars/datacenter/scripts/read_lapalma-tapes	(revision 9233)
@@ -180,4 +180,6 @@
    date >> $logfile 2>&1
    echo "Moving tape $tape to the export slots." >> $logfile 2>&1
+   #determine slot again, the tape might have been moved manually to another slot
+   tapeslot=`samcmd v 100 | grep "$tape " | cut -c-4 | sed -e 's/ //g'`
    samcmd export 100:$tapeslot
 else
@@ -191,4 +193,6 @@
          echo "Tried 10 times to launch movingrawfiles without avail. Finishing now." >> $logfile 2>&1
          echo "Moving tape $tape to the export slots." >> $logfile 2>&1
+	 #determine slot again, the tape might have been moved manually to another slot
+	 tapeslot=`samcmd v 100 | grep "$tape " | cut -c-4 | sed -e 's/ //g'`
    	 samcmd export 100:$tapeslot
          echo -e "\nTape $tape read but the files have NOT been moved. You will have to do it manually. The tape has been exported. Have a nice day." >> $logfile 2>&1
