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

Last change on this file since 7471 was 7471, 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.02
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
49
50function makedir()
51{
52 if [ ! -d $@ ]
53 then
54 mkdir -pv $@
55 if [ ! -d $@ ]
56 then
57 echo "could not make dir "$@
58 exit
59 fi
60 fi
61}
62
63function resetstatusvalues()
64{
65 statustime=NULL
66 starttime=NULL
67 failedcode=NULL
68 failedcomment=NULL
69 failedtime=NULL
70}
71
72function printstatusvalues()
73{
74 echo "the current values are:"
75 echo " statustime=$statustime"
76 echo " starttime=$starttime"
77 echo " failedcode=$failedcode"
78 echo " failedcomment=$failedcomment"
79 echo " failedtime=$failedtime"
80 echo "-- check: -$check-"
81 echo ""
82}
83
84function setstatus()
85{
86 # set status values
87 resetstatusvalues
88 case $@ in
89 start) echo "start"
90 starttime="Now()"
91 ;;
92 stop) echo "stop"
93 case $check in
94 0) echo " ok"
95 statustime="Now()"
96 ;;
97 *) echo " failed"
98 starttime=noreset
99 failedcode=$check
100 failedcomment=$com
101 failedtime="Now()"
102 ;;
103 esac
104 ;;
105 *) echo "error -> exit"
106 exit
107 ;;
108 esac
109 check=
110
111# printstatusvalues
112 # set status
113 setstatuslogpath=$logpath/setstatus/$program/$var1
114 makedir $setstatuslogpath
115 setstatuslog=$setstatuslogpath/setstatus-$@-$program-$var2.log
116 checkstatus=`root -q -b $macrospath/setstatus.C+\("\"$sequence\""\,"\"$table\""\,"\"$column\""\,"\"$statustime\""\,"\"$failedcode\""\,"\"$failedcomment\""\,"\"$starttime\""\,"\"$failedtime\""\) | tee $setstatuslog | grep int | sed -e 's/(int)//'`
117 case $checkstatus in
118 1) echo "checkstatus=$checkstatus -> everything ok, status has been set"
119 *) echo "checkstatus=$checkstatus -> ERROR -> step could not be set"
120 esac
121}
122
123
124
Note: See TracBrowser for help on using the repository browser.