[Mailman-Users] Purging old archives over 7 years old

Julian H. Stacey jhs at berklix.com
Thu Jun 15 09:05:15 EDT 2017


Steven Jones wrote:
> Hi,
> 
> 
> I have a 12year old mailman server which is absorbing 650gb of expensive disk space. Is there any feature that would go through each list's archives and delete emails over say 7 years old?   (or maybe even only 3 as we do a yearly backup going back a decade).

I've no idea if mailman has own special tools for that,
standard Unix tools can find tools that use the Unix find command, eg
	echo "Learn find, dialects vary per Unix."
	man find 
	cd /usr/local/mailman/bin 
	echo "Get an idea where to look:"
	find . -type f | sort | xargs grep -l find | more
	find . -type f | sort | xargs grep -l find \
		| grep -v /archives/ \
		| grep -v /lists/ \
		| grep -v /logs/ \
		| grep -v /messages/ \
		| grep -v /templates/ \
		| grep -v /tests/ \
		| more
	echo "Ignore ./cgi-bin/* binaries."
	vi -c/find `find bin/* scripts/* -type f | xargs grep -l find`
	echo "Also consider ./Mailman/*/*.py[c] files"

Or more simply:

cd /usr/local/mailman/archives
find . -type f -name \*.html | more
	./private/pc532/index.html
	./private/pc532/2017q2/000000.html
	./private/pc532/2017q2/date.html
	./private/pc532/2017q2/subject.html
	./private/pc532/2017q2/author.html
	./private/pc532/2017q2/thread.html
	./private/pc532/2017q2/000001.html
	./private/pc532/2017q2/000002.html

so eg
	rm -rf ./private/pc532/2007*

find . -type f -name \*.html | xargs ls -l > ~/tmp/dates_to_browse
find . -type f -name \[0-9\]\*.html
find . -type d -name 2012q\* | more
find . -type d -name 2012q\* | xargs rm -rf

Find is very powerful.  Read 
	man find
before you use find,
use 
	more
before you use
	rm
Do a backup before anything. 

Cheers,
Julian
-- 
Julian Stacey, Computer Consultant, BSD Linux Unix Systems Engineer
 Reply below, Prefix '> '. Plain text, No .doc, base64, HTML, quoted-printable.
 http://berklix.eu/brexit/#stolen_votes  Starve a troll: Ignore Trump's tweets.


More information about the Mailman-Users mailing list