From 2a18d08cfe9ba79ea711a44573fe568662362433 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Thu, 6 Oct 2022 09:50:26 -0500 Subject: Maybe ... archive better?! --- runsfeed | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'runsfeed') diff --git a/runsfeed b/runsfeed index 6f6b161..52539a1 100755 --- a/runsfeed +++ b/runsfeed @@ -163,7 +163,13 @@ archive() ( # sfeed_archive AGE FEED ... shift # shellcheck disable=2031 old="$sfeedpath/../sfeed.old.d" - mkdir -p "$old" + if test -d "$old"; then + mv "$old" "${old}2" + mkdir -p "$old" + mv "${old}2" "$old/old" + else + mkdir -p "$old" + fi for feed; do awk -v old="$(($(date +%s) - (age * 24 * 3600)))" \ -F '\t' 'int($1) > old' <"$feed" >"$feed.new" -- cgit 1.4.1-21-gabe81