source: trunk/MagicSoft/Mars/datacenter/scripts/dowebplots@ 7316

Last change on this file since 7316 was 7316, checked in by Daniela Dorner, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.3 KB
Line 
1#!/bin/sh
2#
3# ========================================================================
4#
5# *
6# * This file is part of MARS, the MAGIC Analysis and Reconstruction
7# * Software. It is distributed to you in the hope that it can be a useful
8# * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
9# * It is distributed WITHOUT ANY WARRANTY.
10# *
11# * Permission to use, copy, modify and distribute this software and its
12# * documentation for any purpose is hereby granted without fee,
13# * provided that the above copyright notice appear in all copies and
14# * that both that copyright notice and this permission notice appear
15# * in supporting documentation. It is provided "as is" without express
16# * or implied warranty.
17# *
18#
19#
20# Author(s): Daniela Dorner 08/2005 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2004
23#
24#
25# ========================================================================
26#
27#
28
29user=`whoami`
30source /home/$user/Mars/datacenter/scripts/sourcefile
31
32set -C
33
34cd $mars
35
36datetime=`date +%F-%H-%M-%S`
37
38scriptlogpath=$logpath/run/dowebplots/`date +%Y/%m/%d`
39makedir $scriptlogpath
40
41scriptlog=$scriptlogpath/dowebplots-$datetime.log
42
43date >> $scriptlog 2>&1
44
45lockfile=$lockpath/lock-dowebplots.txt
46date > $lockfile >> $scriptlog 2>&1
47checklock0=$?
48case $checklock0 in
49 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
50 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
51 echo "-> for datacheck is running -> exit" >> $scriptlog 2>&1
52 date >> $scriptlog 2>&1
53 exit;;
54 *) echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
55esac
56
57
58
59rootfiles=`find /www/htdocs/datacenter/ -name '*.root' -maxdepth 10 | grep -v '_I_' | grep -v '_Y_' | grep -v 'subsystemdata'`
60
61if [ "$rootfiles" = "" ]
62then
63 echo "nothing to do -> exit" >> $scriptlog 2>&1
64 rm -v $lockfile >> $scriptlog 2>&1
65 date >> $scriptlog 2>&1
66 exit
67fi
68
69echo "rootfiles: "${rootfiles[@]} >> $scriptlog 2>&1
70
71for rootfile in ${rootfiles[@]}
72do
73 date >> $scriptlog 2>&1
74 path=`dirname $rootfile`
75 file=`basename $rootfile`
76 base=`echo $file | sed -e 's/.root$//g'`
77 echo "file $file" >> $scriptlog 2>&1
78 echo "path $path" >> $scriptlog 2>&1
79 echo "base $base" >> $scriptlog 2>&1
80
81 if ls $path/$base-tab*.gif >> $scriptlog 2>&1
82 then
83 continue
84 fi
85
86 tabfile=$path/$base-tab
87 daterootfile=`date +%Y%m%d -r $rootfile` >> $scriptlog 2>&1
88 dategiffile=`date +%Y%m%d -r $tabfile1.gif` >> $scriptlog 2>&1
89 if [ "$dategiffile" = "" ]
90 then
91 dategiffile=50000000
92 fi
93# now=`date +%Y%m%d`
94
95 echo "date of rootfile: $daterootfile" >> $scriptlog 2>&1
96 echo "date of giffile: $dategiffile" >> $scriptlog 2>&1
97
98 if [ "$dategiffile" -lt "$daterootfile" ] >> $scriptlog 2>&1
99 then
100 continue
101 fi
102
103 echo "produce plots..." >> $scriptlog 2>&1
104 X=0
105 while [ "$X" -le "50" ] >> $scriptlog 2>&1
106 do
107 X=$((X+1))
108 echo "$X. step" >> $scriptlog 2>&1
109 ./showplot -b --save-as-ps=$tabfile$X --tab=$X $rootfile >> $scriptlog 2>&1
110 if ! ls $tabfile$X.ps >> $scriptlog 2>&1
111 then
112 break
113 fi
114 convert -rotate 90 $tabfile$X.ps $tabfile$X.gif >> $scriptlog 2>&1
115 done
116done
117
118rm -v $lockfile >> $scriptlog 2>&1
119
120set +C
121
122date >> $scriptlog 2>&1
123
Note: See TracBrowser for help on using the repository browser.