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 script, which launches other scripts
|
---|
28 | #
|
---|
29 |
|
---|
30 | source `dirname $0`/sourcefile
|
---|
31 |
|
---|
32 | makedir $listpath
|
---|
33 | makedir $lockpath
|
---|
34 |
|
---|
35 | sllogpath=$logpath/scriptlauncher/`date +%Y/%m`
|
---|
36 | makedir $sllogpath
|
---|
37 | errorlog=$sllogpath/error`date +%F`.log
|
---|
38 | scriptlog=$sllogpath/scriptlauncher`date +%F`.log
|
---|
39 |
|
---|
40 | echo `date`": starting $0 $@" >> $scriptlog 2>&1
|
---|
41 |
|
---|
42 | path=`dirname $0`
|
---|
43 | date=`date +%Y/%m/%d`
|
---|
44 | date2=`date +%Y-%m-%d`
|
---|
45 | condordir=$logpath/condor/$date
|
---|
46 | makedir $condordir >> $scriptlog 2>&1
|
---|
47 |
|
---|
48 | for i in $@
|
---|
49 | do
|
---|
50 | if [ "$i" = "allatthesametime" ]
|
---|
51 | then
|
---|
52 | continue
|
---|
53 | fi
|
---|
54 | echo " launching $i..." >> $scriptlog 2>&1
|
---|
55 | pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$i -a date=$date2 -a dir=$condordir $path/run.condor | grep cluster | cut -dr -f2` 2>$errorlog
|
---|
56 | if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog
|
---|
57 | then
|
---|
58 | echo " waiting for $i to be done..." >> $scriptlog 2>&1
|
---|
59 | /usr/local/bin/condor_wait $condordir/condor-$date2.log $pid >/dev/null 2>$errorlog
|
---|
60 | fi
|
---|
61 | done
|
---|
62 | echo `date`": all done/submitted." >> $scriptlog 2>&1
|
---|
63 | echo "" >> $scriptlog 2>&1
|
---|
64 |
|
---|