From d5b7cd9dbd18b1cfc284b707e6083d7e6bd80008 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Sun, 17 Jul 2022 23:38:21 -0500 Subject: Archive feeds older than 60 days --- runsfeed | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/runsfeed b/runsfeed index f987a92..e6714a7 100755 --- a/runsfeed +++ b/runsfeed @@ -27,6 +27,8 @@ main() { atom "$sfeedpath" 7 >"$SFEED_OUTPUT/feeds-short.xml" log Generating OPML... opml "$sfeedrc" >"$SFEED_OUTPUT/feeds.opml" + log Archiving old feeds... + archive "$sfeedpath"/* log Done. } @@ -63,9 +65,9 @@ atom() ( # atom DIRECTORY [DAYS] sfeed_atom ) -sfeed_archive() ( # sfeed_archive FEED ... +archive() ( # sfeed_archive FEED ... for feed; do - awk -v old="$(($(date +%s) - (15 * 24 * 3600)))" \ + awk -v old="$(($(date +%s) - (60 * 24 * 3600)))" \ -F '\t' 'int($1) > old' <"$feed" >"$feed.new" mv "$feed" "$feed.old" mv "$feed.new" "$feed" -- cgit 1.4.1-21-gabe81