forked from passing/lonometer-dump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcronjob.sh
executable file
·112 lines (94 loc) · 3.12 KB
/
cronjob.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
set -e
cd /home/niklas/templog
### fetch and update data
/home/niklas/Dev/core-process/lonometer-dump/lonometer-dump.pl -b 84:DD:20:EF:09:97 -r /home/niklas/templog/
/bin/bash /home/niklas/templog/update.sh
### generate graphs
# humidity
rrdtool graph 84DD20EF0997_rh_day.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -86400 --end now \
--vertical-label "%rH" \
DEF:humidity=84DD20EF0997_rh.rrd:value:AVERAGE \
LINE1:humidity#ff0000:"humidity"
rrdtool graph 84DD20EF0997_rh_week.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -604800 --end now \
--vertical-label "%rH" \
DEF:humidity=84DD20EF0997_rh.rrd:value:AVERAGE \
LINE1:humidity#ff0000:"humidity"
rrdtool graph 84DD20EF0997_rh_month.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -2592000 --end now \
--vertical-label "%rH" \
DEF:humidity=84DD20EF0997_rh.rrd:value:AVERAGE \
LINE1:humidity#ff0000:"humidity"
rrdtool graph 84DD20EF0997_rh_year.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -31104000 --end now \
--vertical-label "%rH" \
DEF:humidity=84DD20EF0997_rh.rrd:value:AVERAGE \
LINE1:humidity#ff0000:"humidity"
# temperature
rrdtool graph 84DD20EF0997_temp_day.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -86400 --end now \
--vertical-label "°C" \
DEF:temperature=84DD20EF0997_temp.rrd:value:AVERAGE \
LINE1:temperature#ff0000:"temperature"
rrdtool graph 84DD20EF0997_temp_week.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -604800 --end now \
--vertical-label "°C" \
DEF:temperature=84DD20EF0997_temp.rrd:value:AVERAGE \
LINE1:temperature#ff0000:"temperature"
rrdtool graph 84DD20EF0997_temp_month.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -2592000 --end now \
--vertical-label "°C" \
DEF:temperature=84DD20EF0997_temp.rrd:value:AVERAGE \
LINE1:temperature#ff0000:"temperature"
rrdtool graph 84DD20EF0997_temp_year.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -31104000 --end now \
--vertical-label "°C" \
DEF:temperature=84DD20EF0997_temp.rrd:value:AVERAGE \
LINE1:temperature#ff0000:"temperature"
# battery
rrdtool graph 84DD20EF0997_bat_day.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -86400 --end now \
--vertical-label "%" \
DEF:battery=84DD20EF0997_bat.rrd:value:AVERAGE \
LINE1:battery#ff0000:"battery"
rrdtool graph 84DD20EF0997_bat_week.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -604800 --end now \
--vertical-label "%" \
DEF:battery=84DD20EF0997_bat.rrd:value:AVERAGE \
LINE1:battery#ff0000:"battery"
rrdtool graph 84DD20EF0997_bat_month.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -2592000 --end now \
--vertical-label "%" \
DEF:battery=84DD20EF0997_bat.rrd:value:AVERAGE \
LINE1:battery#ff0000:"battery"
rrdtool graph 84DD20EF0997_bat_year.png \
-w 800 -h 450 -a PNG \
--slope-mode \
--start -31104000 --end now \
--vertical-label "%" \
DEF:battery=84DD20EF0997_bat.rrd:value:AVERAGE \
LINE1:battery#ff0000:"battery"