Topic on Talk:Mailing lists

Jump to navigation Jump to search

Bash script for archiving lists...

3
DanielRenfro (talkcontribs)

Maybe I missed something, but I have yet to find a good way to search the archives of a list. When doing research I commonly want to read all the old messages and grep through them. So I wrote this little bash script:

#!/bin/bash

_URL="http://lists.wikimedia.org/pipermail/mediawiki-l/"

if test -n "$( find . -maxdepth 1 -type f -name '*.txt' -print -quit )"
then
        echo 'Deleting old archives...'
        rm *.txt
fi

for _GZIP_FILE in $( wget --quiet -O - $_URL | perl -ne 'print "$1\n" if /href="(\d{4}[^"]+\.gz)"/g;' )
do
        echo "Fetching $_GZIP_FILE..."
        wget --quiet "${_URL}${_GZIP_FILE}"
        gunzip $_GZIP_FILE
done

Create a new folder, put this script it there and then run it. Might be useful to somebody else...

Nemo bis (talkcontribs)

Assuming you're speaking of mailman mailing lists, you can just download the whole archive in mbox format. Look for mailman docs.

Reply to "Bash script for archiving lists..."