about summary refs log tree commit diff stats
path: root/runsfeed
diff options
context:
space:
mode:
Diffstat (limited to 'runsfeed')
-rwxr-xr-xrunsfeed8
1 files changed, 7 insertions, 1 deletions
diff --git a/runsfeed b/runsfeed index 6f6b161..52539a1 100755 --- a/runsfeed +++ b/runsfeed
@@ -163,7 +163,13 @@ archive() ( # sfeed_archive AGE FEED ...
163 shift 163 shift
164 # shellcheck disable=2031 164 # shellcheck disable=2031
165 old="$sfeedpath/../sfeed.old.d" 165 old="$sfeedpath/../sfeed.old.d"
166 mkdir -p "$old" 166 if test -d "$old"; then
167 mv "$old" "${old}2"
168 mkdir -p "$old"
169 mv "${old}2" "$old/old"
170 else
171 mkdir -p "$old"
172 fi
167 for feed; do 173 for feed; do
168 awk -v old="$(($(date +%s) - (age * 24 * 3600)))" \ 174 awk -v old="$(($(date +%s) - (age * 24 * 3600)))" \
169 -F '\t' 'int($1) > old' <"$feed" >"$feed.new" 175 -F '\t' 'int($1) > old' <"$feed" >"$feed.new"