Index: trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 9130)
+++ trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 9131)
@@ -216,5 +216,5 @@
 #moving the files
 file=""
-opticalfiles=`find $transdir/optical -name '*.instr'`
+opticalfiles=`find $transdir/optical -regextype posix-egrep -regex '^$transdir/optical/20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]_.*_[RV][_]?[12]?[.]instr$'`
 for opticalfile in $opticalfiles
 do
@@ -243,12 +243,19 @@
          fi
          ;;
-      3) echo " checkfilloptical=$checkfilloptical - Error: position of one object is missing in the database" >> $scriptlog 2>&1 
-         printprocesslog "ERROR filloptical.C failed for $opticalfile because the position of one object is missing in the database"
-         continue
-         ;;
-      *) echo " checkfilloptical=$checkfilloptical - Error -> go on with next file" >> $scriptlog 2>&1 
-         printprocesslog "ERROR filloptical.C failed for $opticalfile"
-         continue
-         ;;
+      3) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: position of one object is missing in the database" >> $scriptlog 2>&1 
+         printprocesslog "ERROR filloptical.C failed for $opticalfile: position of one object is missing in the database"
+         continue ;;
+      4) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: telescope line with more or less than 2 arguments" >> $scriptlog 2>&1 
+         printprocesslog "ERROR filloptical.C failed for $opticalfile: telescope line with more or less than 2 arguments"
+         continue ;;
+      5) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: timestamp line with more or less than 4 arguments" >> $scriptlog 2>&1 
+         printprocesslog "ERROR filloptical.C failed for $opticalfile: timestamp line with more or less than 4 arguments"
+         continue ;;
+      6) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile: object line with more or less than 8 arguments" >> $scriptlog 2>&1 
+         printprocesslog "ERROR filloptical.C failed for $opticalfile: object line with more or less than 8 arguments"
+         continue ;;
+      *) echo " checkfilloptical=$checkfilloptical - ERROR filloptical.C failed for $opticalfile -> go on with next file" >> $scriptlog 2>&1 
+         printprocesslog "ERROR filloptical.C failed for $opticalfile (returned $checkfilloptical)"
+         continue ;;
    esac
 done
Index: trunk/MagicSoft/Mars/datacenter/scripts/dbchk
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dbchk	(revision 9130)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dbchk	(revision 9131)
@@ -161,5 +161,5 @@
 # CHECK 2
 echo "Checking if all sequences in Sequences have a corresponding sequence files" >> $scriptlog 2>&1
-sequences=`echo SELECT fSequenceFirst FROM Sequences | mymysql`
+sequences=`echo SELECT fSequenceFirst FROM Sequences left join SequenceProcessStatus using (fSequenceFirst,fTelescopeNumber) where not isnull(fSequenceFileWritten) | mymysql`
 for sequence in $sequences
 do
