Index: trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 8469)
+++ trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 8482)
@@ -20,5 +20,5 @@
 #   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2006
+#   Copyright: MAGIC Software Development, 2000-2007
 #
 #
@@ -99,5 +99,5 @@
 
 #find all dates in transfer-directory
-dates=`find $transdir/*/ -type d | grep -o --regexp=20[0-9][0-9]_[0-1][0-9]_[0-3][0-9]` >> $scriptlog 2>&1
+dates=`find $transdir/*/ -type d | grep -o --regexp=20[0-9][0-9]_[0-1][0-9]_[0-3][0-9] | sort | uniq` >> $scriptlog 2>&1
 if ! [ "$dates" = "" ]
 then 
@@ -220,5 +220,4 @@
 do
    printprocesslog "INFO process "$opticalfile
-#   echo $opticalfile
    file=`basename $opticalfile`
    year=`echo $file | cut -c 0-4`
@@ -226,8 +225,6 @@
    makedir $opticallogpath >> $scriptlog 2>&1
    opticallogfile=$opticallogpath/filloptical-$file.log
-#   echo "logfile: "$opticallogfile
   
    checkfilloptical=`root -q -b $macrospath/filloptical.C+\("\"$opticalfile\""\,kFALSE\) | tee $opticallogfile | intgrep`
-#   checkfilloptical=`root -q -b $macrospath/filloptical.C+\("\"$opticalfile\""\) | tee $opticallogfile | intgrep`
             
    case $checkfilloptical in
@@ -266,5 +263,10 @@
 
 #getting new catalogfiles 
-catfiles=`find $subsystempath/cc/ -name $magfav -newer $catalog | sort`
+for (( i=0 ; i < 31 ; i++ ))
+do
+   date=`date --date "-${i}day" +%Y/%m/%d`
+   path=$subsystempath/cc/$date
+   catfiles=$catfiles" "`find $path -name $magfav -newer $catalog`
+done
 
 for catfile in ${catfiles[@]}
