source: trunk/MagicSoft/Mars/datacenter/scripts/runstar@ 8182

Last change on this file since 8182 was 8176, checked in by Daniela Dorner, 18 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.0 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/2004 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2006
23#
24#
25# ========================================================================
26#
27# This script is launching star for sequence.
28#
29# In the case of star only one sequence is processed. Despite of
30# that the structure of the script is such, that also more sequences could
31# be processed. The restriction to one sequence has been made, as star
32# takes some time. There's one todo file per sequence.
33# First the script searches for a todo file. Then star is run for the
34# sequence from this todo file.
35#
36# the star.rc files are taken from the mars directory
37#
38
39source `dirname $0`/sourcefile
40printprocesslog "INFO starting $0"
41program=star
42column=fStar
43
44set -C
45
46scriptlog=$runlogpath/run$program-$datetime.log
47date >> $scriptlog 2>&1
48
49# get sequence #
50gettodo >> $scriptlog 2>&1
51sequence=$process
52
53# lock sequ
54lockfile=$lockpath/lock-$table-$column-$sequence.txt
55checklock >> $scriptlog 2>&1
56
57cd $mars
58
59echo "run $program for sequence $sequence..." >> $scriptlog 2>&1
60printprocesslog "INFO starting $program for sequence $sequence"
61no=`printf %08d $sequence | cut -c 0-4`
62no2=`printf %08d $sequence`
63var1=$no
64var2=$no2
65outpath="$datapath/$program/$no/$no2"
66inpath=`echo $outpath | sed -e 's/star/callisto/'`
67makedir $outpath >> $scriptlog 2>&1
68
69sequfile="$sequpath/$no/sequence$no2.txt"
70
71setstatus "start" >> $scriptlog 2>&1
72
73ssh pegasus /opt/SUNWsamfs/bin/stage $inpath/*_Y_*.root &
74
75echo "./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null" >> $scriptlog 2>&1
76./star -b -q -v4 -f --log=$outpath/$program$no2.log --html=$outpath/$program$no2.html --ind=$inpath --out=$outpath $sequfile 2>> $scriptlog> /dev/null
77check1=$?
78
79case $check1 in
80 0) echo " check1=$check1 -> everything ok " >> $scriptlog 2>&1
81 printprocesslog "INFO $program finished successfully for sequence $sequence"
82 ;;
83 *) echo " check1=$check1 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
84 printprocesslog "ERROR $program failed for sequence $sequence"
85 com=$Fstar
86 check=$check1
87 ;;
88esac
89
90setstatus "stop" >> $scriptlog 2>&1
91
92finish >> $scriptlog 2>&1
93
Note: See TracBrowser for help on using the repository browser.