Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7029)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7030)
@@ -21,4 +21,18 @@
 
                                                  -*-*- END OF LINE -*-*-
+ 2005/05/13 Daniela Dorner
+
+   * datacenter/scripts/sourcefile
+     - added (file with commands and variables, that are needed by all
+       scripts
+
+   * datacenter/scripts/buildsequenceentries, checkfilesforsequenceavail
+                        copyscript, correcttime, doexclusions, 
+                        filesondisk, fillcallisto, fillstar, runcallisto
+                        runstar, writesequencefiles
+     - adapted scripts to the usage of the sourcefile
+
+
+
  2005/05/13 Thomas Bretz
 
Index: /trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/buildsequenceentries	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 cd $mars
@@ -46,6 +40,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/buildsequenceentries/$year
 getstatuslog=$getstatuslogpath/getstatus-buildsequenceentries-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/checkfilesforsequenceavail	(revision 7030)
@@ -27,10 +27,5 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 table=SequenceProcessStatus
@@ -41,5 +36,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/checkfileavail/$year
 getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/copyscript
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/copyscript	(revision 7030)
@@ -57,7 +57,5 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
@@ -65,14 +63,8 @@
 umask 0002
 
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 transdir=/magic/datacenter/transfer
 char=28
 extern=MAGIC@virgo:/data/MAGIC/transfer
 datetime=`date +%F-%H-%M-%S`
-
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 
 scriptlogpath=$logpath/run/copyscript/`date +%Y/%m/%d`
Index: /trunk/MagicSoft/Mars/datacenter/scripts/correcttime
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/correcttime	(revision 7030)
@@ -27,10 +27,5 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 table=RunProcessStatus
@@ -41,5 +36,4 @@
 
 listdir=/magic/datacenter/lists
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/correct_raw_time/$year
 getstatuslog=$getstatuslogpath/getstatus-$table-$column-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/doexclusions
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/doexclusions	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 cd $mars
@@ -46,6 +40,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/doexclusions/$year
 getstatuslog=$getstatuslogpath/getstatus-doexcludions-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/filesondisk	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/filesondisk	(revision 7030)
@@ -27,10 +27,5 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 cd $mars
@@ -39,12 +34,12 @@
 subsystemdir=/magic/subsystemdata
 rawdir=/magic/data
-logpath=/magic/datacenter/autologs/filesondisk/`date +%Y`
+filesondisklogpath=$logpath/filesondisk/`date +%Y`
 
-if [ ! -d $logpath ]
+if [ ! -d $filesondisklogpath ]
 then
-  mkdir -pv $logpath 
-  if [ ! -d $logpath ]
+  mkdir -pv $filesondisklogpath 
+  if [ ! -d $filesondisklogpath ]
   then 
-     echo "could not make directory "$logpath 
+     echo "could not make directory "$filesondisklogpath 
      exit
   fi
@@ -55,5 +50,5 @@
 echo "checking disk for ccfiles..." 
 
-filename=$logpath/ccfilesondisk-$date.txt
+filename=$filesondisklogpath/ccfilesondisk-$date.txt
 column=fCCFileAvail
 
@@ -62,5 +57,5 @@
 
 echo "resetting runs..."
-check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $logpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'`
+check3=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'`
 
 case $check3 in 
@@ -73,5 +68,5 @@
 echo "checking disk for cacofiles..." 
 
-filename=$logpath/cacofilesondisk-$date.txt
+filename=$filesondisklogpath/cacofilesondisk-$date.txt
 column=fCaCoFileAvail
 
@@ -80,5 +75,5 @@
 
 echo "resetting runs..."
-check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $logpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'`
+check0=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'`
 
 case $check0 in 
@@ -90,5 +85,5 @@
 
 echo "checking missing cacofiles..."
-check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\) | tee $logpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'`
+check1=`root -q -b $macrospath/findcacofiles.C+\("\"$date\""\) | tee $filesondisklogpath/findcacofiles-$date.log | grep int | sed -e 's/(int)//'`
 
 case $check1 in 
@@ -97,5 +92,5 @@
 esac
 
-missingcacoruns=(`cat $logpath/findcacofiles-$date.txt`)
+missingcacoruns=(`cat $filesondisklogpath/findcacofiles-$date.txt`)
 
 for missingcacorun in ${missingcacoruns[@]}
@@ -122,5 +117,5 @@
       else
          echo "inserting cacofile $file for run $missingcacorun..."
-         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $logpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'`
+         check2=`root -q -b $macrospath/insertcacofile.C+\("\"$runno\""\,"\"$newrun\""\) | tee $filesondisklogpath/insertcacofile-$missingcacorun.log | grep int | sed -e 's/(int)//'`
 
          case $check2 in
@@ -139,5 +134,5 @@
 echo "checking disk for rawfiles..." 
 
-filename=$logpath/rawfilesondisk-$date.txt
+filename=$filesondisklogpath/rawfilesondisk-$date.txt
 column=fRawFileAvail
 
@@ -145,5 +140,5 @@
 
 echo "resetting runs..."                                    
-check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $logpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'` 
+check4=`root -q -b $macrospath/resetallruns.C+\("\"$filename\""\,"\"$column\""\) | tee $filesondisklogpath/resetall-$column-$date.log | grep int | sed -e 's/(int)//'` 
 
 case $check4 in 
Index: /trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/fillcallisto	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 table=SequenceProcessStatus
@@ -44,6 +38,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/fillcallisto/$year
 getstatuslog=$getstatuslogpath/getstatus-fillcallisto-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/fillstar
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/fillstar	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 table=SequenceProcessStatus
@@ -44,6 +38,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/fillstar/$year
 getstatuslog=$getstatuslogpath/getstatus-fillstar-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/runcallisto
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/runcallisto	(revision 7030)
@@ -27,13 +27,8 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
 
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 callistorcnew=/magic/datacenter/setup/callisto/callisto.rc
 
@@ -46,6 +41,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/callisto/$year
 getstatuslog=$getstatuslogpath/getstatus-callisto-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/runstar
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/runstar	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 table=SequenceProcessStatus
@@ -45,6 +39,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/star/$year
 getstatuslog=$getstatuslogpath/getstatus-star-$datetime.log
Index: /trunk/MagicSoft/Mars/datacenter/scripts/sourcefile
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7030)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/sourcefile	(revision 7030)
@@ -0,0 +1,39 @@
+#!/bin/sh
+#
+# ========================================================================
+#
+# *
+# * This file is part of MARS, the MAGIC Analysis and Reconstruction
+# * Software. It is distributed to you in the hope that it can be a useful
+# * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
+# * It is distributed WITHOUT ANY WARRANTY.
+# *
+# * Permission to use, copy, modify and distribute this software and its
+# * documentation for any purpose is hereby granted without fee,
+# * provided that the above copyright notice appear in all copies and
+# * that both that copyright notice and this permission notice appear
+# * in supporting documentation. It is provided "as is" without express
+# * or implied warranty.
+# *
+#
+#
+#   Author(s): Daniela Dorner  05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
+#
+#   Copyright: MAGIC Software Development, 2000-2004
+#
+#
+# ========================================================================
+#
+#
+
+export ROOTSYS=/opt/root_v4.04.02
+export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
+export PATH=$PATH:$ROOTSYS/bin
+
+mars=/home/operator/Mars
+macrospath=$mars/datacenter/macros
+scriptspath=$mars/datacenter/scripts
+
+lockpath=/magic/datacenter/locks
+logpath=/magic/datacenter/autologs
+
Index: /trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7029)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/writesequencefiles	(revision 7030)
@@ -27,13 +27,7 @@
 #
 
-export ROOTSYS=/opt/root_v3.10.02
-export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
-export PATH=$PATH:$ROOTSYS/bin
+source /home/operator/Mars/datacenter/scripts/sourcefile
 
 set -C
-
-mars=/home/operator/Mars
-macrospath=$mars/datacenter/macros
-scriptspath=$mars/datacenter/scripts
 
 table=SequenceProcessStatus
@@ -44,6 +38,4 @@
 
 todofile=/magic/datacenter/lists/ToDo-$table-$column.txt
-lockpath=/magic/datacenter/locks
-logpath=/magic/datacenter/autologs
 getstatuslogpath=$logpath/getstatus/writesequencefiles/$year
 getstatuslog=$getstatuslogpath/getstatus-writesequencefiles-$datetime.log
