| 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 |
|
|---|
| 29 | user=`whoami`
|
|---|
| 30 | source /home/$user/Mars/datacenter/scripts/sourcefile
|
|---|
| 31 |
|
|---|
| 32 | set -C
|
|---|
| 33 |
|
|---|
| 34 | callistorcseq=callisto.rc
|
|---|
| 35 | callistorcnew=callisto_Dec04Jan05.rc
|
|---|
| 36 |
|
|---|
| 37 | scriptlogpath=$logpath/run/makecallistolinks/`date +%Y/%m/%d`
|
|---|
| 38 | makedir $scriptlogpath
|
|---|
| 39 | scriptlog=$scriptlogpath/makingcallistolinks`date +%F`.log
|
|---|
| 40 |
|
|---|
| 41 | date >> $scriptlog 2>&1
|
|---|
| 42 |
|
|---|
| 43 | lockfile=$lockpath/lock-making-callisto-links.txt
|
|---|
| 44 | date > $lockfile >> $scriptlog 2>&1
|
|---|
| 45 | checklock0=$?
|
|---|
| 46 | case $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;;
|
|---|
| 53 | esac
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | reason="Pulse is too much to the right, cannot go beyond logain limits!"
|
|---|
| 57 | echo "reason: "$reason >> $scriptlog 2>&1
|
|---|
| 58 |
|
|---|
| 59 | files=`find $datapath/callisto -name callisto*.log`
|
|---|
| 60 |
|
|---|
| 61 | for file in $files
|
|---|
| 62 | do
|
|---|
| 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/$callistorcnew $path/$callistorcseq >> $scriptlog 2>&1
|
|---|
| 68 | fi
|
|---|
| 69 | done
|
|---|
| 70 |
|
|---|
| 71 | rm -v $lockfile >> $scriptlog 2>&1
|
|---|
| 72 |
|
|---|
| 73 | set +C
|
|---|
| 74 |
|
|---|
| 75 | date >> $scriptlog 2>&1
|
|---|
| 76 |
|
|---|