Index: trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7456)
+++ trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7460)
@@ -20,5 +20,5 @@
 #   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
 #
-#   Copyright: MAGIC Software Development, 2000-2004
+#   Copyright: MAGIC Software Development, 2000-2006
 #
 #
@@ -27,11 +27,10 @@
 #
 # This script handles the subsystem logfiles, which are copied every
-# day automatically from pc15 in La Palma to /data/MAGIC/transfer/ in
-# Wuerzburg
+# day automatically from /local/ on pc15 in La Palma to 
+# /home/lapalma/transfer/ on coma in the datacenter in Wuerzburg
 # The structure in this directory is: subsystem/date/logfile.*
 # The logfiles are from CC (*.rep, CC*.dbg, CC*.rbk, CC*.rep, CC*.run,
-# CC*.run.html) and Cosy (cosy*.log, cosy*.rep, tpoint*.txt/starg*.txt) 
-# AMC (AMC*.log, AMC*.info, AMC*.lut) and CaCo (dc*.txt) are not copied
-# every day automatically
+# CC*.run.html), Cosy (cosy*.log, cosy*.rep, tpoint*.txt/starg*.txt) 
+# AMC (AMC*.log, AMC*.info, AMC*.lut) and CaCo (dc*.txt) 
 #
 # the script performs the following steps:
@@ -40,9 +39,10 @@
 # using the macros filldotrbk.C and filldotrun.C
 # - copying all logfiles to the correct directory:
-# /Period*/subsystem/date/file.*
-# (the period for each date is obtained by the macro getperiod.C) 
-# - filling the sequences for the standard analysis into the database
-# (for each day of which a file was copied) 
-# 
+# /subsystemdata/subsystem/YYYY/MM/DD/file.*
+# - building the sequences for the standard analysis in the database
+#   (for each day of which a file was copied) 
+# - if a new catalogfile has been copied, it is installed as standard in the
+#   setup directory /magic/datacenter/setup and the new lines are sent to 
+#   the adresses specified in the script
 # 
 # -- to make sure that no file is copied twice there's a textfile
@@ -66,5 +66,4 @@
 transdir=/home/lapalma/transfer
 char=28
-#extern=MAGIC@virgo:/data/MAGIC/transfer
 datetime=`date +%F-%H-%M-%S`
 
@@ -76,4 +75,5 @@
 date >> $scriptlog 2>&1
 
+# check if the script is already running
 date > $lockpath/lock-copyscript.txt >> $scriptlog 2>&1 
 checklock0=$?
@@ -87,12 +87,9 @@
 esac
 
-# rsync new dc with virgo
-#rsync -av $extern/ $transdir  >> $scriptlog 2>&1 
-
 cd $transdir
 
 #check the checksums, write output into file
 md5sum -c .checksums | tee $transdir/.check  >> $scriptlog 2>&1 
-#md5sum -c $transdir/checksums-test >| $transdir/.check 
+
 if ! test -e $transdir/.check
 then
@@ -113,5 +110,4 @@
 #dates=`ls $transdir/*/ -1 | grep --regexp=20[0-9][0-9]_*[0-1][0-9]_*[0-3][0-9] | grep -v '.tgz'`
 dates=`ls $transdir/*/ -1 | grep --regexp=20[0-9][0-9]_[0-1][0-9]_[0-3][0-9] | grep -v '.tgz'` >> $scriptlog 2>&1
-
 if [ "$dates" = "" ]
 then 
@@ -123,5 +119,4 @@
 
 echo "dates found: "$dates  >> $scriptlog 2>&1 
-
 #loop over dates 
 for date in ${dates[@]}
@@ -138,5 +133,4 @@
    
    date2=`echo $date | sed -e 's/_/\//g'`
-#   echo "date2=$date2"
    copylogpath=$logpath/copyscript/$date2
    echo "copylogpath: "$copylogpath >> $scriptlog 2>&1
@@ -148,5 +142,4 @@
       echo "file: "$file  >> $scriptlog 2>&1 
       filename=`basename $file`
-#      echo "filename: "$filename
                         
       #check for each file whether it has to be processed
@@ -179,6 +172,5 @@
                1) echo "checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1 
                   echo "-> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1 
-#                  date3=`echo $date | sed -e 's/_/-/g'`
-#                  echo "date3=$date3"
+
                   checkinsertdate=`root -q -b $macrospath/insertdate.C+\("\"$date\""\) | tee $copylogpath/insertdate-$date-log.txt   | grep int | sed -e 's/(int)//'`
                   case $checkinsertdate in
@@ -224,7 +216,4 @@
 
 rm -v $transdir/.check >> $scriptlog 2>&1 
-
-#rsync -av $transdir/ $extern >> $scriptlog 2>&1 
-#rsync -av --delete $transdir/ $extern >> $scriptlog 2>&1 
 
 
