Index: /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
===================================================================
--- /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots	(revision 7317)
+++ /trunk/MagicSoft/Mars/datacenter/scripts/dowebplots	(revision 7318)
@@ -75,31 +75,13 @@
    file=`basename $rootfile`
    base=`echo $file | sed -e 's/.root$//g'`
-   echo "file $file" >> $scriptlog 2>&1
-   echo "path $path" >> $scriptlog 2>&1
-   echo "base $base" >> $scriptlog 2>&1
+   echo "rootfile: $file" >> $scriptlog 2>&1
+   echo "path    : $path" >> $scriptlog 2>&1
+   echo "base    : $base" >> $scriptlog 2>&1
    
-   if ls $path/$base-tab*.gif  >> $scriptlog 2>&1
-   then 
-      continue
-   fi
+#   if ls $path/$base-tab*.gif  >> $scriptlog 2>&1
+#   then 
+#      continue
+#   fi
    
-   tabfile=$path/$base-tab
-   daterootfile=`date +%Y%m%d -r $rootfile` >> $scriptlog 2>&1
-   dategiffile=`date +%Y%m%d -r $tabfile1.gif` >> $scriptlog 2>&1
-   if [ "$dategiffile" = "" ] 
-   then 
-      dategiffile=50000000
-   fi
-#   now=`date +%Y%m%d`
-
-   echo "date of rootfile: $daterootfile" >> $scriptlog 2>&1
-   echo "date of giffile: $dategiffile"  >> $scriptlog 2>&1
-   
-   if [ "$dategiffile" -lt "$daterootfile" ] >> $scriptlog 2>&1
-   then 
-      continue
-   fi
-   
-   echo "produce plots..." >> $scriptlog 2>&1
    X=0
    while [ "$X" -le "50" ] >> $scriptlog 2>&1
@@ -107,9 +89,33 @@
       X=$((X+1))
       echo "$X. step" >> $scriptlog 2>&1
+
+      tabfile=$path/$base-tab$X
+      daterootfile=`date +%Y%m%d -r $rootfile` >> $scriptlog 2>&1
+      dategiffile=`date +%Y%m%d -r $tabfile.gif` >> $scriptlog 2>&1
+      if [ "$dategiffile" = "" ]
+      then
+         echo "date of gif-file is empty -> the file $tabfile.gif doesn't exist" >> $scriptlog 2>&1
+         echo " -> setting date to 0 and producing gif-file..." >> $scriptlog 2>&1
+         dategiffile=0
+      fi
+
+      echo "checking date..."  >> $scriptlog 2>&1
+      echo "date of rootfile: $daterootfile" >> $scriptlog 2>&1
+      echo "date of giffile:  $dategiffile"  >> $scriptlog 2>&1
+
+      if [ "$dategiffile" -gt "$daterootfile" ] >> $scriptlog 2>&1
+      then
+         echo "gif-file is older than root-file -> continue " >> $scriptlog 2>&1
+         continue
+      fi
+
+      echo "producing ps-file with plots for tab $X..." >> $scriptlog 2>&1
       ./showplot -b --save-as-ps=$tabfile$X --tab=$X $rootfile >> $scriptlog 2>&1
       if ! ls $tabfile$X.ps >> $scriptlog 2>&1
       then 
+         echo "tab $X doen't exist -> break" >> $scriptlog 2>&1
          break
       fi
+      echo "converting plots to gif for tab $X..." >> $scriptlog 2>&1
       convert -rotate 90 $tabfile$X.ps $tabfile$X.gif >> $scriptlog 2>&1
    done
