-
Notifications
You must be signed in to change notification settings - Fork 0
/
run-syndl-obs.sh
57 lines (46 loc) · 1.33 KB
/
run-syndl-obs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
PATH=/bin:/usr/bin
: ${phase:?} ${base:?} ${reftime:?} ${datedir:?} ${nwp:?}
: ${ruby:=/usr/bin/ruby}
: ${syndl:=${nwp}/bin/syndl.rb}
: ${app:='https://www.wis-jma.go.jp/data/syn?ContentType=Text&Access=Open'}
: ${ca:='--ca=/etc/ssl/certs/'}
if tty -s; then
ruby="${ruby} -w"
fi
set -e
rc=0 && $ruby $syndl ${datedir}/obsan-etag.db ${datedir}/obsan-log.db \
--tar=obsan-${reftime}.tar $ca --tag=obsan \
--match='TEMP|PILOT' \
"${app}&Type=Alphanumeric&Category=Upper+air" \
--match='SYNOP|SHIP|BUOY|RADOB|WAVEOB' \
"${app}&Type=Alphanumeric&Category=Surface" \
--match='' "${app}&Type=Alphanumeric&Subcategory=CLIMAT" \
|| rc=$?
prio='-p news.err -s'
case $rc in
0|16)
prio='-p news.info'
;;
esac
logger --tag syndl.obsan --id=$$ $prio -- "rc=$rc"
sleep 1
rc=0 && $ruby $syndl ${datedir}/obsbf-etag.db ${datedir}/obsbf-log.db \
--tar=obsbf-${reftime}.tar $ca --tag=obsbf \
--match='TEMP|PILOT' \
"${app}&Type=BUFR&Category=Upper+air" \
--match='SYNOP|SHIP|BUOY|RADOB|WAVEOB' \
"${app}&Type=BUFR&Category=Surface" \
--match='A_IU(PC[45]|[KS]C[67])[0-9]RJTD' \
"${app}&Type=BUFR&Category=Empty+or+Invalid" \
--match='SAREP' \
"${app}&Type=BUFR&Category=Satellite" \
|| rc=$?
prio='-p news.err -s'
case $rc in
0|16)
prio='-p news.info'
;;
esac
logger --tag syndl.obsbf --id=$$ $prio -- "rc=$rc"
exit 0