forked from MarcelWaldvogel/chrony-graph
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchrony-graph-loop
More file actions
executable file
·50 lines (39 loc) · 1.22 KB
/
Copy pathchrony-graph-loop
File metadata and controls
executable file
·50 lines (39 loc) · 1.22 KB
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
#!/bin/bash
www_exclude=( --exclude "*.tmpl" --exclude "*.IN" --exclude "measurements.*" --exclude "statistics.*" --exclude "tracking.*" --exclude "*.gmi" )
gemini_exclude=( --include="*/" --exclude="/*.png" --include="*.png" --include="*.gmi" --include="security.txt" --exclude="*" )
# Do not use linlog axes for Remote Clocks Summary for readability
export FORCE_LINEAR_ALLSTAR=1
function generate_home () {
./bin/substitute home/*.IN
rsync -au "${www_exclude[@]}" home/ ./www
rsync -au "${gemini_exclude[@]}" home/ ./gemini/$THISHOST
}
function generate_daily () {
(cd daily && FREQ=Daily ../bin/run --plus-svg 1)
rsync -au "${www_exclude[@]}" daily ./www
rsync -au "${gemini_exclude[@]}" daily ./gemini/$THISHOST
}
function generate_weekly () {
(cd weekly && FREQ=Weekly ../bin/run --plus-svg 7)
rsync -au "${www_exclude[@]}" weekly ./www
rsync -au "${gemini_exclude[@]}" weekly ./gemini/$THISHOST
}
function home_loop() {
duration=0
while [ $duration -lt $INTERVAL ]; do
generate_home
sleep 60
duration=$((duration + 60))
done
}
mkdir -p ./gemini/$THISHOST
generate_home
generate_daily
while true; do
generate_weekly
home_loop
for i in {1..7}; do
generate_daily
home_loop
done
done