Last change
on this file since 20046 was 18864, checked in by Daniela Dorner, 8 years ago |
added (tools to fill satellite visibilities for our sources to the ToO calendar)
|
-
Property svn:executable
set to
*
|
File size:
1.0 KB
|
Line | |
---|
1 | #!/bin/bash
|
---|
2 |
|
---|
3 |
|
---|
4 | source `dirname $0`/../Sourcefile.sh
|
---|
5 | printprocesslog "INFO starting $0"
|
---|
6 |
|
---|
7 | startdate=$1
|
---|
8 | stopdate=$2
|
---|
9 | name=$3
|
---|
10 |
|
---|
11 | if [ "$1" = "" ] || [ "$2" = "" ] || [ "$3" = "" ]
|
---|
12 | then
|
---|
13 | echo "input missing"
|
---|
14 | finish
|
---|
15 | fi
|
---|
16 |
|
---|
17 | if [ $startdate -gt $stopdate ]
|
---|
18 | then
|
---|
19 | echo "start > stop -> exit"
|
---|
20 | finish
|
---|
21 | fi
|
---|
22 |
|
---|
23 | if [ "$4" = "x" ]
|
---|
24 | then
|
---|
25 | printprocesslog "setting ( ) for "$name" from "$startdate" to "$stopdate
|
---|
26 | fi
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 | for (( i=0; i < 1000 ; i++))
|
---|
31 | do
|
---|
32 | date=`date --date="${startdate} ${i}days" +%Y%m%d`
|
---|
33 | if [ $date -gt $stopdate ]
|
---|
34 | then
|
---|
35 | break
|
---|
36 | fi
|
---|
37 | y=`echo $date | cut -c 1-4`
|
---|
38 | m=`echo $date | cut -c 5-6`
|
---|
39 | d=`echo $date | cut -c 7-8`
|
---|
40 |
|
---|
41 | if [ "$4" = "x" ]
|
---|
42 | then
|
---|
43 | query="UPDATE ToOcalendar.Data SET x=1 WHERE y="$y" AND m="$m"-1 AND d="$d" AND u='"$name"'"
|
---|
44 | printprocesslog "INFO update x for "$date" and "$name
|
---|
45 | else
|
---|
46 | query="INSERT ToOcalendar.Data SET y="$y", m="$m"-1, d="$d", u='"$name"'"
|
---|
47 | printprocesslog "INFO insert for "$date" and "$name
|
---|
48 | fi
|
---|
49 | sendquery >> /dev/null
|
---|
50 | #echo $query
|
---|
51 | done
|
---|
52 |
|
---|
53 | finish
|
---|
54 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.