source: trunk/MagicSoft/Mars/datacenter/scripts/sourcefile@ 7475

Last change on this file since 7475 was 7474, checked in by Daniela Dorner, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.4 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 05/2005 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2006
23#
24#
25# ========================================================================
26#
27# This a resource file for the scripts, in which the standard paths and
28# functions, which are needed more often are stored.
29#
30
31export ROOTSYS=/opt/root_v4.04.02g
32export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib
33export PATH=$PATH:$ROOTSYS/bin
34
35mars=/home/operator/Mars
36macrospath=$mars/datacenter/macros
37scriptspath=$mars/datacenter/scripts
38
39logpath=/magic/datacenter/autologs
40lockpath=/magic/datacenter/locks
41listpath=/magic/datacenter/lists
42setuppath=/magic/datacenter/setup
43
44datapath=/magic/data
45subsystempath=/magic/subsystemdata
46sequpath=/magic/sequences
47datasetpath=/magic/datasets
48
49check="ok"
50
51
52function makedir()
53{
54 if [ ! -d $@ ]
55 then
56 mkdir -pv $@
57 if [ ! -d $@ ]
58 then
59 echo "could not make dir "$@
60 exit
61 fi
62 fi
63}
64
65function resetstatusvalues()
66{
67 statustime=NULL
68 starttime=NULL
69 failedcode=NULL
70 failedcomment=NULL
71 failedtime=NULL
72}
73
74function printstatusvalues()
75{
76 echo "the current values are:"
77 echo " statustime=$statustime"
78 echo " starttime=$starttime"
79 echo " failedcode=$failedcode"
80 echo " failedcomment=$failedcomment"
81 echo " failedtime=$failedtime"
82 echo "-- check: -$check-"
83 echo ""
84}
85
86function setstatus()
87{
88 # set status values
89 resetstatusvalues
90 case $@ in
91 start) echo "start"
92 starttime="Now()"
93 ;;
94 stop) echo "stop"
95 case $check in
96 ok) echo " ok"
97 statustime="Now()"
98 ;;
99 *) echo " failed"
100 starttime=noreset
101 failedcode=$check
102 failedcomment=$com
103 failedtime="Now()"
104 ;;
105 esac
106 ;;
107 *) echo "error -> exit"
108 exit
109 ;;
110 esac
111
112# printstatusvalues
113 # set status
114 setstatuslogpath=$logpath/setstatus/$program/$var1
115 makedir $setstatuslogpath
116 setstatuslog=$setstatuslogpath/setstatus-$@-$program-$var2.log
117 checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failedcode\""\,"\"$failedcomment\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
118 case $checkstatus in
119 1) echo "checkstatus=$checkstatus -> everything ok, status has been set";;
120 *) echo "checkstatus=$checkstatus -> ERROR -> step could not be set";;
121 esac
122}
123
124
125
Note: See TracBrowser for help on using the repository browser.