[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Clear out old news



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