[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Clear out old news
- Subject: Clear out old news
- From: Chris Warburton
- Date: Mon, 26 Jun 2017 04:28:49 +0100
- Resolution: fixed
- State: resolved
News folders are getting pretty big, we should clear out high traffic ones like
BBCNews and HackerNews periodically, e.g. after refreshing, using a command like
CUTOFF=$(date -d "last month" "+%s")
find Mail/feeds/HackerNews/cur/ -type f |
while read -r F
do
D=$(grep "^Date: " < "$F" | sed -e 's/^Date: //g')
SECS=$(date -d "$D" "+%s")
if [[ "$SECS" -lt "$CUTOFF" ]]
then
rm "$F"
fi
done