source: trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher@ 8461

Last change on this file since 8461 was 8461, checked in by Daniela Dorner, 17 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.1 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/2006 <mailto:dorner@astro.uni-wuerzburg.de>
21#
22# Copyright: MAGIC Software Development, 2000-2006
23#
24#
25# ========================================================================
26#
27# This a script, which launches other scripts
28#
29
30source `dirname $0`/sourcefile
31printprocesslog "INFO starting $0 $@"
32
33makedir $listpath
34makedir $lockpath
35
36errorlog=$runlogpath/scriptlauncher-error`date +%F`.log
37scriptlog=$runlogpath/scriptlauncher`date +%F`.log
38
39echo `date`": starting $0 $@" >> $scriptlog 2>&1
40
41path=`dirname $0`
42date=`date +%Y-%m-%d`
43
44for i in $@
45do
46 if [ "$i" = "allatthesametime" ]
47 then
48 continue
49 fi
50 echo " launching $i..." >> $scriptlog 2>&1
51 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date -a dir=$runlogpath $path/run.condor >> $errorlog | grep 'submitted to cluster' | cut -dr -f2`
52 if [ "$pid" = "" ]
53 then
54 echo `date`" WARN condor is not working " >> $errorlog 2>&1
55 printprocesslog "WARN submitting $i to condor failed"
56 fi
57 if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog
58 then
59 echo " waiting for $i to be done..." >> $scriptlog 2>&1
60 /usr/local/bin/condor_wait $runlogpath/condor-$date.log $pid >/dev/null 2>$errorlog
61 fi
62done
63echo `date`": all done/submitted." >> $scriptlog 2>&1
64echo "" >> $scriptlog 2>&1
65
66printprocesslog "INFO finished $0 $@"
67
Note: See TracBrowser for help on using the repository browser.