Index: trunk/MagicSoft/Mars/datacenter/scripts/budb
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/budb	(revision 9135)
+++ trunk/MagicSoft/Mars/datacenter/scripts/budb	(revision 9136)
@@ -32,4 +32,7 @@
 olday=`date +%F --date="-30day"`
 
+source `dirname $0`/sourcefile
+printprocesslog "INFO starting $0"
+
 set -C
 
@@ -59,10 +62,19 @@
 
 echo "writing all databases to $zipfile..." >> $logfile 2>&1
-set +C
+
 # complete databases 
-mysqldump --host=vela --all-databases -u dump | bzip2 -9 -c > $zipfile 2>> $logfile
+if ! mysqldump --host=vela --all-databases -u dump | bzip2 -9 -c >| $zipfile 2>> $logfile
+then
+   printprocesslog "ERROR mysqldump failed "
+   echo "ERROR mysqldump failed " >> $logfile 2>&1
+fi
 echo "writing create commands to $command..." >> $logfile 2>&1
 # commands to create MyMagic
-mysqldump --host=vela --database $dbname -u dump --no-data > $command 2>> $logfile
+if ! mysqldump --host=vela --database $dbname -u dump --no-data >| $command 2>> $logfile
+then
+   printprocesslog "ERROR mysqldump failed "
+   echo "ERROR mysqldump failed " >> $logfile 2>&1
+fi
 
+finish >> $logfile 2>&1
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 9135)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkmd5sum	(revision 9136)
@@ -30,12 +30,11 @@
 # transferred together with the logfile.
 #
-# The script will be automised by being executed after reading tapes with
-# the not-yet finished script readlapalmatapes. At the moment it is being
-# executed by hand.
-#
 
-echo "Please specify the tape number (e.g. 3MG005)."
-read no
-echo "Thank you. Your query is being processed. This may take some time."
+no=$@
+if [ "$no" == "" ]
+then
+   echo "no tape specified -> aborting"
+   exit
+fi
 
 checkpath=/home/lapalma/tapecont/cont/muxdata/checksums
@@ -43,8 +42,9 @@
 L=`echo $file | cut -c49`
 id=${no}L${L}
+logfile=${checkpath}/tape_${id}.log
 
 if [ ! -f $file ]
 then
-   echo "tape $file not found -> aborting"
+   echo "tape $file not found -> aborting" >> $logfile 2>&1
    exit
 fi
@@ -52,11 +52,19 @@
 if [ -f ${checkpath}/tape_${id}.md5.lapalma ] || [ -f ${checkpath}/tape_${id}.md5.wue ]
 then
-   echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
-   read cont
-   if [ ! $cont == "yes" ]
-   then
-      echo "Aborting."
-      exit
-   fi
+   echo "Output files already existing -> aborting" >> $logfile 2>&1
+   exit
+#   echo "Output files already existing. Are you sure you wish to continue (yes/no)?"
+#   read cont
+#   if [ ! $cont == "yes" ]
+#   then
+#      echo "Aborting."
+#      exit
+#   fi
+fi
+
+if [ "`cat $file`" == "" ]
+then
+   echo "$file is empty, the checksums are missing -> aborting" >> $logfile 2>&1
+   exit
 fi
 
@@ -77,5 +85,5 @@
       if [ ! -f /magic/datacenter/fromtape/${sum[0]} ] && [ ! -f /data/fromtape/${sum[0]} ]
       then
-      	echo "File ${sum[0]} does not exist."
+      	echo "File ${sum[0]} does not exist." >> $logfile 2>&1
         continue
       fi
@@ -86,8 +94,7 @@
       if [ ! -f /magic/datacenter/fromtape/${sum[0]} ]
       then
-         ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
+         nice -n 19 /opt/csw/bin/gmd5sum /data/fromtape/${sum[0]} | sed -e 's/\/data\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
       else
-         ssh -nx phoenix nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
-         #md5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
+         nice -n 19 /opt/csw/bin/gmd5sum /magic/datacenter/fromtape/${sum[0]} | sed -e 's/\/magic\/datacenter\/fromtape\///' >> ${checkpath}/tape_${id}.md5.wue
       fi
    fi
@@ -98,9 +105,9 @@
 if [ ! -f ${checkpath}/tape_${id}.md5.lapalma ] || [ ! -f ${checkpath}/tape_${id}.md5.wue ]
 then
-   echo "No output files written! Something went wrong... -> aborting"
+   echo "No output files written! Something went wrong... -> aborting" >> $logfile 2>&1
    exit
 fi
 
-echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now."
+echo "Wrote checksums to ${checkpath}/tape_${id}.md5.lapalma and ${checkpath}/tape_${id}.md5.wue. Comparing now." >> $logfile 2>&1
 
 # check for differences in the checksums
@@ -109,15 +116,15 @@
 if [ "$output" = "" ]
 then
-   echo "All checksums are identical!"
+   echo "All checksums are identical." >> $logfile 2>&1
    muxschk=`grep muxdata/20[01][0-9].*/20[01][0-9].*.raw ${checkpath}/tape_${id}.md5.wue | wc -l`
    if [ $muxslog == $muxschk ]
    then
-      echo "Number of checked files matches. Launching movingrawfiles now. (to be included)" | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
+      echo "Number of checked files matches. Files are ready." >> $logfile 2>&1
    else
-      echo "Number of checked files doesn't match number of extracted files. Something went wrong..." | tee -a ${checkpath}/tape_${id}.md5.lapalma | tee -a ${checkpath}/tape_${id}.md5.wue
+      echo "Number of checked files doesn't match number of extracted files. Something went wrong..." >> $logfile 2>&1
    fi
 else
-   echo -e "The files are not identical! diff found the following differences:\n$output"
+   echo -e "The files are not identical! diff found the following differences:\n$output" >> $logfile 2>&1
 fi
 
-echo "program terminated."
+echo "Program terminated." >> $logfile 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 9135)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 9136)
@@ -75,8 +75,22 @@
 
 echo "staging files..." >> $scriptlog 2>&1
-ssh -nx phoenix /opt/SUNWsamfs/bin/stage -V $inpath/20*_0*${run}_Y_*_E.root >> $scriptlog 2>&1
+ssh -nx phoenix /opt/SUNWsamfs/bin/stage -V $inpath/20[01][0-9]*_0*${run}_Y_*.root >> $scriptlog 2>&1
 
-echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
-./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null
+
+# define star.rc files
+starrcnew=$setuppath/$program/star.rc
+starrcmux=$setuppath/$program/star_mux.rc
+# link star.rc file
+echo "linking the star.rc file to $outpath" >> $scriptlog 2>&1
+if [ $sequence -gt 200000 ]
+then
+   ln -vsf $starrcmux $outpath/star.rc >> $scriptlog 2>&1
+else
+   ln -vsf $starrcnew $outpath/star.rc >> $scriptlog 2>&1
+fi
+starrcseq=$outpath/star.rc
+
+echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
+./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile --config=$starrcseq 2>> $scriptlog> /dev/null
 check1=$?
 
