Changeset 7453 for trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
- Timestamp:
- 12/12/05 16:30:50 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/dowebplots
r7426 r7453 35 35 36 36 datetime=`date +%F-%H-%M-%S` 37 webdir=/www/htdocs/datacenter 37 38 38 39 scriptlogpath=$logpath/run/dowebplots/`date +%Y/%m/%d` … … 56 57 57 58 59 #finding all rootfiles in the webdirectory 60 #this are all statusdisplays 61 rootfiles=`find $webdir/{sinope,callisto,star,ganymed}/ -name '*.root' -maxdepth 10 | grep -v '_I_' | grep -v '_Y_' | grep -v 'subsystemdata' | grep -v 'star_lapalma'` 58 62 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 61 64 if [ "$rootfiles" = "" ] 62 65 then … … 67 70 fi 68 71 69 echo "rootfiles: "${rootfiles[@]} >> $scriptlog 2>&170 72 73 #produce plots for each rootfile 71 74 for rootfile in ${rootfiles[@]} 72 75 do 73 76 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'` 75 81 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 77 84 85 #get date of root- and psfile 78 86 daterootfile=`date +%Y%m%d -r $rootfile` >> $scriptlog 2>&1 79 87 datepsfile=`date +%Y%m%d -r $psfile` >> $scriptlog 2>&1 … … 89 97 echo "date of psfile: $datepsfile" >> $scriptlog 2>&1 90 98 99 #if the psfile is newer than the rootfile 100 #no plots have to be done -> continue 91 101 if [ "$datepsfile" -gt "$daterootfile" ] >> $scriptlog 2>&1 92 102 then … … 99 109 100 110 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 112 done 113 114 echo "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 121 dirs=`find $webdir/{star,callisto,ganymed,sinope}/* -type d | grep -v merpplogs` 122 123 for dir in ${dir[@]} 124 do 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 102 146 done 103 147
Note:
See TracChangeset
for help on using the changeset viewer.