Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7953)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7954)
@@ -18,4 +18,34 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2006/08/29 Daniela Dorner
+
+   * datacenter/scripts/buildsequenceentries:
+     - fixed logpath
+
+   * datacenter/scripts/fillcallisto, datacenter/scripts/fillganymed,
+     datacenter/scripts/fillstar:
+     - changed logpath
+
+   * datacenter/scripts/insertdatasets:
+     - improved logging
+
+   * datacenter/scripts/sourcefile:
+     - improved logging in setstatus
+     - implemented alias intgrep
+
+   * datacenter/scripts/buildsequenceentries, 
+     datacenter/scripts/checkfilesforsequenceavail, 
+     datacenter/scripts/checkstardone, datacenter/scripts/copyscript, 
+     datacenter/scripts/dodatacheck, datacenter/scripts/doexclusions,
+     datacenter/scripts/doqualityplots, datacenter/scripts/filesondisk,
+     datacenter/scripts/fillcallisto, datacenter/scripts/fillganymed,
+     datacenter/scripts/fillstar, datacenter/scripts/insertdatasets,
+     datacenter/scripts/insertsequences, 
+     datacenter/scripts/makecallistolinks, 
+     datacenter/scripts/writesequencefiles:
+     - implemented usage of alias intgrep
+
+
+
  2006/08/28 Thomas Bretz
 
Index: trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7954)
@@ -73,9 +73,9 @@
    buildsequentriespath=$logpath/$program/$year2
    makedir  $buildsequentriespath >> $scriptlog 2>&1
-   buildsequenceentrieslog=$buildsequentriespath/buildsequenceentries-$date.log
+   buildsequentrieslog=$buildsequentriespath/buildsequenceentries-$date.log
 
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequeentrieslog | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/buildsequenceentries.C+\("\"$date\""\,"\"$datapath\""\,"\"$sequpath\""\,kFALSE\) | tee $buildsequentrieslog | intgrep`
 
    case $check1 in
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7954)
@@ -78,5 +78,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $checkfileavaillog | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/checkfileavail.C+\(\""$sequencefile\""\) | tee $checkfileavaillog | intgrep`
 
    case $check1 in
Index: trunk/MagicSoft/Mars/datacenter/scripts/checkstardone
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/checkstardone	(revision 7954)
@@ -91,5 +91,5 @@
       printprocesslog "INFO check availability for sequence $sequence"
 
-      check1=`root -q -b $macrospath/checkstardone.C+\(\""$sequence\""\) | tee $outpath/checkstardone-$sequence.log | grep int | sed -e 's/(int)//'`
+      check1=`root -q -b $macrospath/checkstardone.C+\(\""$sequence\""\) | tee $outpath/checkstardone-$sequence.log | intgrep`
 
       case $check1 in
Index: trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7954)
@@ -147,5 +147,7 @@
          then
             echo "found rbk-file $filename"  >> $scriptlog 2>&1 
-            checkfillrbk=`root -q -b $macrospath/filldotrbk.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrbk-$filename-log.txt | grep int | sed -e 's/(int)//'`
+            
+            checkfillrbk=`root -q -b $macrospath/filldotrbk.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrbk-$filename-log.txt | intgrep`
+            
             case $checkfillrbk in
                1) echo " checkfillrbk=$checkfillrbk -> everything ok " >> $scriptlog 2>&1 
@@ -158,13 +160,17 @@
             esac
          fi
+         
          if echo $file | grep 'CC_.*.run' >> $scriptlog 2>&1  && ! echo $file | grep .run.html >> $scriptlog 2>&1 
          then
             echo "found run-file $filename" >> $scriptlog 2>&1 
-            checkfillrun=`root -q -b $macrospath/filldotrun.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrun-$filename-log.txt  | grep int | sed -e 's/(int)//'`
+            
+            checkfillrun=`root -q -b $macrospath/filldotrun.C+\("\"$file\""\,kFALSE\) | tee $copylogpath/filldotrun-$filename-log.txt | intgrep`
+            
             case $checkfillrun in
                1) echo " checkfillrun=$checkfillrun -> everything ok " >> $scriptlog 2>&1 
                   echo "  -> insert date in SequenceBuildStatus for $date" >> $scriptlog 2>&1 
 
-                  checkinsertdate=`root -q -b $macrospath/insertdate.C+\("\"$date\""\) | tee $copylogpath/insertdate-$date-log.txt   | grep int | sed -e 's/(int)//'`
+                  checkinsertdate=`root -q -b $macrospath/insertdate.C+\("\"$date\""\) | tee $copylogpath/insertdate-$date-log.txt | intgrep`
+                  
                   case $checkinsertdate in
                      1) echo "date inserted" >> $scriptlog 2>&1 ;;
Index: trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/dodatacheck	(revision 7954)
@@ -79,5 +79,5 @@
 filldotrawlogfile=$filldotrawpath/filldotraw-$no2.log
 
-check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | grep int | sed -e 's/.*(int)//'`
+check1=`root -q -b $macrospath/filldotraw.C+\("\"$rawfile\""\,kFALSE\) | tee $filldotrawlogfile | intgrep`
 
 case $check1 in 
@@ -132,5 +132,5 @@
 
 echo "doing fillsinope..." >> $scriptlog 2>&1
-check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | grep int | sed -e 's/.*(int)//'`
+check3=`root -q -b $macrospath/fillsinope.C+\($run\,"\"$datapath\""\,kFALSE\) | tee $fillsinopelogfile | intgrep`
 
 case $check3 in 
@@ -158,5 +158,5 @@
 resetlog=$resetlogpath/reset-exclusions-$no2-$date2.log
 
-check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
+check5=`root -q -b $macrospath/resetcolumn.C+\("\"fExclusionsDone\""\,"\"SequenceBuildStatus\""\,"\"$date2\""\,"\"$date2\""\,kFALSE\) | tee $resetlog | intgrep`
 case $check5 in
    1)   echo " check5=$check5 -> everything ok, fExclusions have been reset " >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7954)
@@ -77,5 +77,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionslog | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/doexclusions.C+\("\"$date\""\) | tee $doexclusionslog | intgrep`
 
    case $check1 in
Index: trunk/MagicSoft/Mars/datacenter/scripts/doqualityplots
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/doqualityplots	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/doqualityplots	(revision 7954)
@@ -51,5 +51,5 @@
 echo "producing plots: " >> $scriptlog 2>&1
 printprocesslog "INFO producing data quality plots"
-check0=`root -q -b $macrospath/plotdb.C+\(\) | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'`
+check0=`root -q -b $macrospath/plotdb.C+\(\) | tee -a $scriptlog | intgrep`
 
 case $check0 in 
@@ -98,5 +98,5 @@
    makedir $outpath >> $scriptlog 2>&1
    rm -v $plotlog >> $scriptlog 2>&1
-   check1=`root -q -b $macrospath/plotdb.C+\("\"$datasetfile\""\) 2>>$plotlog | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'`
+   check1=`root -q -b $macrospath/plotdb.C+\("\"$datasetfile\""\) 2>>$plotlog | tee -a $scriptlog | intgrep`
    echo " check1: "$check1 >> $scriptlog 2>&1
    newpsfile=$outpath/plotdb$nr.ps
Index: trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/filesondisk	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/filesondisk	(revision 7954)
@@ -70,5 +70,5 @@
 
 echo "resetting runs..." >> $scriptlog 2>&1
-check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'`
+check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | intgrep`
 
 case $check3 in 
@@ -92,5 +92,5 @@
 
 echo "resetting runs..." >> $scriptlog 2>&1 
-check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'`
+check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | intgrep`
 
 case $check0 in 
@@ -109,5 +109,5 @@
 echo "checking missing cacofiles..." >> $scriptlog 2>&1 
 printprocesslog "INFO checking missing cacofiles"
-check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | grep int | sed -e 's/(int)//'`
+check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\,"\"$filesondisklogpath\""\) | tee $filesondisklogpath/findcacofiles-$datetime.log | intgrep`
 
 case $check1 in 
@@ -149,5 +149,5 @@
          printprocesslog "INFO inserting cacofile for run $missingcacorun"
          echo " inserting cacofile $file for run $missingcacorun..." >> $scriptlog 2>&1 
-         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'`
+         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | intgrep`
 
          case $check2 in
@@ -182,5 +182,5 @@
 
 echo "resetting runs..." >> $scriptlog 2>&1 
-check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | grep int | sed -e 's/(int)//'` 
+check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$datetime.log | intgrep`
 
 case $check4 in 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7954)
@@ -43,5 +43,5 @@
 set -C
 
-scriptlog=$runlogpath/run$program-$datetime.log
+scriptlog=$runlogpath/$program-$datetime.log
 date >> $scriptlog 2>&1
 
@@ -85,5 +85,5 @@
    printprocesslog "INFO starting fillcalib for sequence $sequence"
 
-   check1=`root -q -b $macrospath/fillcalib.C+\("\"$calibfile\""\,kFALSE\) | tee $fillcaliblog | grep int | sed -e 's/(int)//'`
+   check1=`root -q -b $macrospath/fillcalib.C+\("\"$calibfile\""\,kFALSE\) | tee $fillcaliblog | intgrep`
 
    case $check1 in
@@ -105,5 +105,5 @@
 
    printprocesslog "INFO starting fillsignal for sequence $sequence"
-   check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | grep int | sed -e 's/(int)//'`
+   check2=`root -q -b $macrospath/fillsignal.C+\("\"$signalfile\""\,kFALSE\) | tee $fillsignallog | intgrep`
    case $check2 in
       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillganymed
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillganymed	(revision 7954)
@@ -42,5 +42,5 @@
 set -C
 
-scriptlog=$runlogpath/run$program-$datetime.log
+scriptlog=$runlogpath/$program-$datetime.log
 date >> $scriptlog 2>&1
 
@@ -81,5 +81,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | grep int | sed -e 's/(int)//'`
+   check2=`root -q -b $macrospath/fillganymed.C+\("\"$ganymedfile\""\,kFALSE\) | tee $fillganymedlog | intgrep`
    case $check2 in
       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
Index: trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7954)
@@ -42,5 +42,5 @@
 set -C
 
-scriptlog=$runlogpath/run$program-$datetime.log
+scriptlog=$runlogpath/$program-$datetime.log
 date >> $scriptlog 2>&1
 
@@ -81,5 +81,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | grep \(int\) | sed -e 's/.*(int)//'`
+   check2=`root -q -b $macrospath/fillstar.C+\("\"$starfile\""\,kFALSE\) | tee $fillstarlog | intgrep`
    case $check2 in
       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
Index: trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/insertdatasets	(revision 7954)
@@ -70,5 +70,5 @@
       echo "number in filename and in file are not the same " >> $scriptlog 2>&1 
       echo " -> continue with next dataset" >> $scriptlog 2>&1 
-      printprocesslog "ERROR number in filename and file are not the same for dataset $no2"
+      printprocesslog "ERROR number in filename ($no) and file ($no3) are not the same for dataset $no2"
       continue
    fi
@@ -97,5 +97,5 @@
    printprocesslog "INFO inserting dataset $no2"
    # insert information into db
-   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | grep int | sed -e 's/(int)//'`
+   check0=`root -q -b $macrospath/insertdataset.C+\("\"$no2\""\,"\"$source\""\,"\"$wobble\""\,"\"$comment\""\,kFALSE\) | tee $insertdatasetlog | intgrep`
    case $check0 in 
       1)   echo " check0=$check0 -> everything ok " >> $scriptlog 2>&1 
Index: trunk/MagicSoft/Mars/datacenter/scripts/insertsequences
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/insertsequences	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/insertsequences	(revision 7954)
@@ -66,5 +66,5 @@
    insertsequencelog=$insertsequencepath/$program-$no.log
 
-   check0=`root -q -b $macrospath/insertsequence.C+\("\"$sequencefile\""\,kFALSE\) | tee $insertsequencelog | grep int | sed -e 's/(int)//'`
+   check0=`root -q -b $macrospath/insertsequence.C+\("\"$sequencefile\""\,kFALSE\) | tee $insertsequencelog | intgrep`
    case $check0 in 
       1)   echo "check0=$check0 -> everything ok " >> $scriptlog 2>&1 
Index: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks	(revision 7954)
@@ -84,5 +84,5 @@
          resetlog=$resetlogpath/reset-callisto-$sequ.log
 
-         check1=`root -q -b $macrospath/resetcolumn.C+\("\"$column\""\,"\"$table\""\,"\"$sequ\""\,"\"$sequ\""\,kFALSE\) | tee $resetlog | grep int | sed -e 's/(int)//'`
+         check1=`root -q -b $macrospath/resetcolumn.C+\("\"$column\""\,"\"$table\""\,"\"$sequ\""\,"\"$sequ\""\,kFALSE\) | tee $resetlog | intgrep`
          case $check1 in
             1)   echo " check1=$check1 -> everything ok, callisto has been reset " >> $scriptlog 2>&1
Index: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7954)
@@ -109,4 +109,7 @@
 
 
+# alias
+alias 'intgrep'='grep -E ^\\\(int\\\)[0-9]+$ | sed -e s\/\(int\)\/\/'
+
 # in the following the function, which are needed by several scripts, are 
 # defined
@@ -220,13 +223,12 @@
                starttime="Now()"
                ;;
-       stop)   echo "setstatus stop"
-               case $check in
-                 ok)  echo " ok"
+       stop)   case $check in
+                 ok)  echo "setstatus stop - ok"
                       statustime="Now()"
                       ;;
-                 no)  echo "nothing new"
+                 no)  echo "setstatus stop - nothing new"
                       check="ok"
                       ;;
-                  *)  echo " failed"
+                  *)  echo "setstatus stop - failed"
                       starttime=noreset
                       returncode=$check
@@ -428,5 +430,5 @@
    fi
    query=$query", fFailedTime=$failedtime, fFailedCode=$failedcode, fFailedCodeAdd=$failedcodeadd, fReturnCode=$returncode "
-   query=$query" where $primary=$var2"
+   query=$query" where $primary='$var2'"
    echo " QUERY: "$query
    if ! mysql -s -u $us --password=$pw --host=hercules $db -e " $query "
Index: trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7953)
+++ trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7954)
@@ -82,5 +82,5 @@
    setstatus "start" >> $scriptlog 2>&1
 
-   check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelog | grep int | sed -e 's/(int)//'`
+   check2=`root -q -b $macrospath/writesequencefile.C+\($sequence\,"\"$sequpath\""\) | tee $writesequencefilelog | intgrep`
    case $check2 in
       1)   echo " check2=$check2 -> everything ok " >> $scriptlog 2>&1 
