about summary refs log tree commit diff stats
path: root/runsfeed
diff options
context:
space:
mode:
authorCase Duckworth2022-10-06 09:50:26 -0500
committerCase Duckworth2022-10-06 09:50:26 -0500
commit2a18d08cfe9ba79ea711a44573fe568662362433 (patch)
tree3b16195150cbd8a9c90351fb3ff41c907cb0c0a0 /runsfeed
parentAdd william vaughn (nackjickleson) (diff)
downloadsfeed-2a18d08cfe9ba79ea711a44573fe568662362433.tar.gz
sfeed-2a18d08cfe9ba79ea711a44573fe568662362433.zip
Maybe ... archive better?!
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"