source: trunk/MagicSoft/Mars/datacenter/scripts/makecallistolinks@ 7353

Last change on this file since 7353 was 7281, checked in by Daniela Dorner, 19 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 2.2 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-2004
23#
24#
25# ========================================================================
26#
27#
28
29user=`whoami`
30source /home/$user/Mars/datacenter/scripts/sourcefile
31
32set -C
33
34callistorcseq=callisto.rc
35callistorcnew=callisto_Dec04Jan05.rc
36
37scriptlogpath=$logpath/run/makecallistolinks/`date +%Y/%m/%d`
38makedir $scriptlogpath
39scriptlog=$scriptlogpath/makingcallistolinks`date +%F`.log
40
41date >> $scriptlog 2>&1
42
43lockfile=$lockpath/lock-making-callisto-links.txt
44date > $lockfile >> $scriptlog 2>&1
45checklock0=$?
46case $checklock0 in
47 0) echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
48 1) echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
49 echo "-> getting list for callisto is running -> exit" >> $scriptlog 2>&1
50 date >> $scriptlog 2>&1
51 exit;;
52 *) echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
53esac
54
55
56reason="Pulse is too much to the right, cannot go beyond logain limits!"
57echo "reason: "$reason >> $scriptlog 2>&1
58
59files=`find $datapath/callisto -name callisto*.log`
60
61for file in $files
62do
63 pulse=`cat $file | grep "$reason"` >> $scriptlog 2>&1
64 if [ ! "$pulse" = "" ]
65 then
66 path=`dirname $file` >> $scriptlog 2>&1
67 ln -vfs $setuppath/callisto/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
68 fi
69done
70
71rm -v $lockfile >> $scriptlog 2>&1
72
73set +C
74
75date >> $scriptlog 2>&1
76
Note: See TracBrowser for help on using the repository browser.