Index: /trunk/MagicSoft/Mars/Changelog
===================================================================
--- /trunk/MagicSoft/Mars/Changelog	(revision 7302)
+++ /trunk/MagicSoft/Mars/Changelog	(revision 7303)
@@ -18,4 +18,12 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2005/08/25 Daniela Dorner
+
+   * datacenter/scripts/dowebplots:
+     - added (script to produce the plots for the websites out of the 
+       rootfiles)
+
+
 
  2005/08/24 Thomas Bretz
Index: /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots	(revision 7303)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots	(revision 7303)
@@ -0,0 +1,115 @@
+#!/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  08/2005 <mailto:dorner@astro.uni-wuerzburg.de>
+#
+#   Copyright: MAGIC Software Development, 2000-2004
+#
+#
+# ========================================================================
+#
+#
+
+user=`whoami`
+source /home/$user/Mars/datacenter/scripts/sourcefile
+
+set -C
+
+cd $mars
+
+datetime=`date +%F-%H-%M-%S`
+
+scriptlogpath=$logpath/run/copyscript/`date +%Y/%m/%d`
+makedir $scriptlogpath
+
+scriptlog=$scriptlogpath/dowebplots-$datetime.log
+
+date >> $scriptlog 2>&1
+
+lockfile=$lockpath/lock-dowebplots.txt
+date > $lockfile >> $scriptlog 2>&1 
+checklock0=$?
+case $checklock0 in 
+    0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
+    1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
+         echo "-> for datacheck is running -> exit" >> $scriptlog 2>&1
+         date  >> $scriptlog 2>&1
+         exit;;
+    *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
+esac
+
+
+
+rootfiles=`find /www/htdocs/datacenter/ -name '*.root' -maxdepth 10`
+
+if [ "$rootfiles" = "" ]
+then 
+   echo "nothing to do -> exit"  >> $scriptlog 2>&1
+   rm -v $lockfile >> $scriptlog 2>&1
+   date  >> $scriptlog 2>&1
+   exit
+fi
+
+echo "rootfiles: "${rootfiles[@]} >> $scriptlog 2>&1
+
+for rootfile in ${rootfiles[@]}
+do 
+   date
+   path=`dirname $rootfile`
+   file=`basename $rootfile`
+   base=`echo $file | sed -e 's/.root$//g'`
+   echo "file $file"
+   echo "path $path"
+   echo "base $base"
+   
+   if ls $path/$base-tab*.gif
+   then 
+      continue
+   fi
+   
+   tabfile=$path/$base-tab
+   daterootfile=`date +%Y%m%d -r $rootfile`
+   dategiffile=`date +%Y%m%d -r $tabfile1.gif`
+#   now=`date +%Y%m%d`
+   
+   if [ $dategiffile -lt $daterootfile ]
+   then 
+      continue
+   fi
+   
+   echo "produce plots..."
+   while [ $X -le 50 ]
+   do 
+      echo "$X's step"
+      ./showplot --save-as-ps=$tabfile$X -tab=$X $rootfile
+      if ! ls $tabfile$X.ps
+      then 
+         break
+      fi
+      convert -rotate $tabfile$X.ps $tabfile$X.gif
+      X=$((X+1))
+   done
+done
+
+rm -v $lockfile >> $scriptlog 2>&1 
+
+set +C
+
+date  >> $scriptlog 2>&1
+
