Index: trunk/MagicSoft/Mars/datacenter/scripts/filesondisk
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/filesondisk	(revision 6934)
+++ 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 
