Ignore:
Timestamp:
12/12/05 16:30:50 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/dowebplots

    r7426 r7453  
    3535
    3636datetime=`date +%F-%H-%M-%S`
     37webdir=/www/htdocs/datacenter
    3738
    3839scriptlogpath=$logpath/run/dowebplots/`date +%Y/%m/%d`
     
    5657
    5758
     59#finding all rootfiles in the webdirectory
     60#this are all statusdisplays
     61rootfiles=`find $webdir/{sinope,callisto,star,ganymed}/ -name '*.root' -maxdepth 10 | grep -v '_I_' | grep -v '_Y_' | grep -v 'subsystemdata' | grep -v 'star_lapalma'`
    5862
    59 rootfiles=`find /www/htdocs/datacenter/ -name '*.root' -maxdepth 10 | grep -v '_I_' | grep -v '_Y_' | grep -v 'subsystemdata' | grep -v 'star_lapalma'`
    60 
     63#exit if no rootfiles are found
    6164if [ "$rootfiles" = "" ]
    6265then
     
    6770fi
    6871
    69 echo "rootfiles: "${rootfiles[@]} >> $scriptlog 2>&1
    7072
     73#produce plots for each rootfile
    7174for rootfile in ${rootfiles[@]}
    7275do
    7376   date >> $scriptlog 2>&1
    74    psfile=`echo $file | sed -e 's/.root$/.ps/g'`
     77   #get names of the psfile and the
     78   #pngfiles (1 per tab in the statusdiplay)
     79   psfile=`echo $rootfile | sed -e 's/.root$/.ps/g'`
     80   tabfile=`echo $rootfile | sed -e 's/.root$/-tab/g'`
    7581   echo "rootfile: $rootfile" >> $scriptlog 2>&1
    76    echo "psfile:   $psfile" >> $scriptlog 2>&1
     82   echo "psfile:   $psfile"   >> $scriptlog 2>&1
     83   echo "tabfile:  $tabfile"  >> $scriptlog 2>&1
    7784   
     85   #get date of root- and psfile
    7886   daterootfile=`date +%Y%m%d -r $rootfile` >> $scriptlog 2>&1
    7987   datepsfile=`date +%Y%m%d -r $psfile` >> $scriptlog 2>&1
     
    8997   echo "date of psfile:   $datepsfile"   >> $scriptlog 2>&1
    9098
     99   #if the psfile is newer than the rootfile
     100   #no plots have to be done -> continue
    91101   if [ "$datepsfile" -gt "$daterootfile" ] >> $scriptlog 2>&1
    92102   then
     
    99109
    100110   echo "converting plots to png..." >> $scriptlog 2>&1
    101    pstoimg -antialias -flip r270 -density 100 -type png -multipage $psfile >> $scriptlog 2>&1
     111   pstoimg -antialias -flip r270 -density 100 -type png -multipage -out=$tabfile$psfile >> $scriptlog 2>&1
     112done
     113
     114echo "removing old files" >> $scriptlog 2>&1
     115#make sure, that old plots of files, that are already removed from disk,
     116#  are deleted also in the webdirectory
     117#this has to be done, as ps and png files are excluded from rsync,
     118#as rsync is done with --delete option (script /home/operator/condor/webupdate
     119
     120#find all directories with plots
     121dirs=`find $webdir/{star,callisto,ganymed,sinope}/* -type d | grep -v merpplogs`
     122
     123for dir in ${dir[@]}
     124do
     125   #find psfiles in directory
     126   psfiles=`ls $dir/*.ps`
     127   #continue, if there are no psfiles
     128   if [ "$psfiles" == "" ]
     129   then
     130      continue
     131   fi
     132   
     133   for psfile in ${psfiles[@]}
     134   do
     135      #create name of corresponding rootfile
     136      rootfile=`echo $psfile | sed -e 's/.ps$/.root/g'`
     137      #delete ps and pngfiles if rootfile is not existing
     138      if ! ls $rootfile >> $scriptlog 2>&1
     139      then
     140         echo "deleting old plots for $rootfile..." >> $scriptlog 2>&1
     141         path=`dirname $psfile`
     142         rm -v $psfile >> $scriptlog 2>&1
     143         rm -v $path/*.png >> $scriptlog 2>&1
     144      fi
     145   done
    102146done
    103147
Note: See TracChangeset for help on using the changeset viewer.