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 |
|
---|
29 | user=`whoami`
|
---|
30 | source /home/$user/Mars/datacenter/scripts/sourcefile
|
---|
31 |
|
---|
32 | set -C
|
---|
33 |
|
---|
34 | cd $mars
|
---|
35 |
|
---|
36 | datetime=`date +%F-%H-%M-%S`
|
---|
37 |
|
---|
38 | scriptlogpath=$logpath/run/doqualityplots/`date +%Y/%m/%d`
|
---|
39 | makedir $scriptlogpath
|
---|
40 |
|
---|
41 | scriptlog=$scriptlogpath/doqualityplots-$datetime.log
|
---|
42 |
|
---|
43 | date >> $scriptlog 2>&1
|
---|
44 |
|
---|
45 | lockfile=$lockpath/lock-doqualityplots.txt
|
---|
46 | date > $lockfile >> $scriptlog 2>&1
|
---|
47 | checklock0=$?
|
---|
48 | case $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;;
|
---|
55 | esac
|
---|
56 |
|
---|
57 |
|
---|
58 | echo "producing plots: " >> $scriptlog 2>&1
|
---|
59 | check0=`root -q -b $macrospath/plotdb.C+\(\) | tee -a $scriptlog | grep int | sed -e 's/.*(int)//'`
|
---|
60 |
|
---|
61 | case $check0 in
|
---|
62 | 1) echo "check0=$check0 -> everything ok -> move files" >> $scriptlog 2>&1;;
|
---|
63 | *) echo "check0=$check0 -> ERROR -> couldn't create plots -> exit" >> $scriptlog 2>&1
|
---|
64 | rm -v $lockfile >> $scriptlog 2>&1
|
---|
65 | exit;;
|
---|
66 | esac
|
---|
67 |
|
---|
68 |
|
---|
69 | webpath=/www/htdocs/datacenter/datacheck
|
---|
70 | name=plotdb
|
---|
71 | psfile=$webpath/$name.ps
|
---|
72 |
|
---|
73 | echo "moving files: " >> $scriptlog 2>&1
|
---|
74 | mv -v $name.{root,ps} $webpath >> $scriptlog 2>&1
|
---|
75 |
|
---|
76 | echo "moving files: " >> $scriptlog 2>&1
|
---|
77 | pstoimg -antialias -flip r270 -density 100 -type png -multipage $psfile >> $scriptlog 2>&1
|
---|
78 |
|
---|
79 | rm -v $lockfile >> $scriptlog 2>&1
|
---|
80 |
|
---|
81 | set +C
|
---|
82 |
|
---|
83 | date >> $scriptlog 2>&1
|
---|
84 |
|
---|