Index: trunk/MagicSoft/Mars/datacenter/scripts/runceres
===================================================================
--- trunk/MagicSoft/Mars/datacenter/scripts/runceres	(revision 9605)
+++ trunk/MagicSoft/Mars/datacenter/scripts/runceres	(revision 9610)
@@ -54,7 +54,4 @@
 setstatus "start"
 
-outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`
-makedir $outpath
-log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
 setupfile=$setuppath/$program/`printf %03d $cereskey`/ceres.rc
 
@@ -65,4 +62,7 @@
    2) printprocesslog "INFO run $run and file $file is a data run (key="$runkey")"
       inputfile=$mcpath/corsika/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`/cer000`printf %06d $file | cut -c 4-6`
+      outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $run | cut -c 1-4`/`printf %08d $run | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run $inputfile"
       printprocesslog "INFO executing "$command
@@ -71,4 +71,8 @@
       ;;
    3) printprocesslog "INFO run $run and file $file is a pedestal run (key="$runkey")"
+      drun=`echo "$run + 2 " | bc -l`
+      $outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $drun | cut -c 1-4`/`printf %08d $drun | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run pedestal"
       printprocesslog "INFO executing "$command
@@ -77,4 +81,8 @@
       ;;
    4) printprocesslog "INFO run $run and file $file is a calibration run (key="$runkey")"
+      drun=`echo "$run + 1 " | bc -l`
+      $outpath=$mcpath/ceres/`printf %03d $cereskey`/`printf %08d $drun | cut -c 1-4`/`printf %08d $drun | cut -c 5-8`
+      makedir $outpath
+      log=$outpath/ceres`printf %08d $run `"."`printf %06d $file | cut -c 4-6`
       command="./ceres -b -q -f --config=$setupfile --out=$outpath --log=$log.log --html=$log.html --run-number=$run calibration"
       printprocesslog "INFO executing "$command
