diff options
author | Case Duckworth | 2022-10-06 09:50:26 -0500 |
---|---|---|
committer | Case Duckworth | 2022-10-06 09:50:26 -0500 |
commit | 2a18d08cfe9ba79ea711a44573fe568662362433 (patch) | |
tree | 3b16195150cbd8a9c90351fb3ff41c907cb0c0a0 | |
parent | Add william vaughn (nackjickleson) (diff) | |
download | sfeed-2a18d08cfe9ba79ea711a44573fe568662362433.tar.gz sfeed-2a18d08cfe9ba79ea711a44573fe568662362433.zip |
Maybe ... archive better?!
-rwxr-xr-x | runsfeed | 8 |
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" |