summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2018-05-31 17:51:28 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2018-05-31 17:51:28 +0200
commitc5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6 (patch)
tree8a0b013fb8ab00d6d0b9222e0e2464fb2a978ea2
parentbb9360bcbec691d7847611ff0b63f15f7563398f (diff)
downloadnixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar
nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.gz
nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.bz2
nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.tar.xz
nixos-c5a3c3f2b3a7f6f13ed3817ed25f5522a0cab4c6.zip
rss_staggered progress output
-rw-r--r--odin/strm/rss_staggered13
1 files changed, 11 insertions, 2 deletions
diff --git a/odin/strm/rss_staggered b/odin/strm/rss_staggered
index 54bbd1a3..c5198a25 100644
--- a/odin/strm/rss_staggered
+++ b/odin/strm/rss_staggered
@@ -7,8 +7,13 @@ staggerFile=~/.rss-stagger
7 7
8[[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || : 8[[ "${FLOCKER}" != "$0" ]] && exec env FLOCKER="$0" flock -x "${staggerFile}" "$0" "$@" || :
9 9
10feeds=$(@rss2email@/bin/r2e list | awk -F ':' 'END { print $1; }') 10typeset -A feeds
11max=$(($feeds + 1)) 11r2e list | while read num junk name junk; do
12 num=${num%:}
13 feeds[${num}]=${name}
14done
15
16max=$(($#feeds))
12num=$(((max * delta_t) / interval)) 17num=$(((max * delta_t) / interval))
13[[ $num -lt 1 ]] && num=1 18[[ $num -lt 1 ]] && num=1
14 19
@@ -17,6 +22,7 @@ now=$((now % max))
17 22
18typeset -a run 23typeset -a run
19run=() 24run=()
25
20typeset -a names 26typeset -a names
21names=() 27names=()
22 28
@@ -25,8 +31,11 @@ n=0
25for i in $(seq $((now + 1)) $((now + num + 1))); do 31for i in $(seq $((now + 1)) $((now + num + 1))); do
26 n=$((i % max)) 32 n=$((i % max))
27 run+=$n 33 run+=$n
34 names+=$feeds[${n}]
28done 35done
29 36
30echo $n >! ${staggerFile} 37echo $n >! ${staggerFile}
31 38
39print ${names}
40
32exec @rss2email@/bin/r2e run $run 41exec @rss2email@/bin/r2e run $run