------------------------------------------------------------
revno: 1447
committer: Mark Sapiro <m...@msapiro.net>
branch nick: 2.1
timestamp: Sun 2014-02-16 15:54:48 -0800
message:
  - Added to the contrib directory, a script from Alain Williams to count
    posts in a list's archive.
added:
  contrib/README.post_count
  contrib/post_count
modified:
  NEWS


--
lp:mailman/2.1
https://code.launchpad.net/~mailman-coders/mailman/2.1

Your team Mailman Checkins is subscribed to branch lp:mailman/2.1.
To unsubscribe from this branch go to 
https://code.launchpad.net/~mailman-coders/mailman/2.1/+edit-subscription
=== modified file 'NEWS'
--- NEWS	2014-02-16 23:00:38 +0000
+++ NEWS	2014-02-16 23:54:48 +0000
@@ -41,6 +41,11 @@
     - Fixed a possible TypeError in bin/sync_members introduced in 2.1.17.
       (LP: #1243343)
 
+  Miscellaneous
+
+    - Added to the contrib directory, a script from Alain Williams to count
+      posts in a list's archive.
+
 2.1.17 (23-Nov-2013)
 
   New Features

=== added file 'contrib/README.post_count'
--- contrib/README.post_count	1970-01-01 00:00:00 +0000
+++ contrib/README.post_count	2014-02-16 23:54:48 +0000
@@ -0,0 +1,14 @@
+This is a bash script to go through the archives of a list and report
+number of posts by month, year and total as well as a rough report of
+total post size by month.
+
+The script was contributed by Alain Williams <a...@phcomp.co.uk>
+and has been slightly modified by Mark Sapiro <m...@msapiro.net> to
+run with only read access to the archive and to remove the perl
+dependency.
+
+The original from Alain is at
+<https://mail.python.org/pipermail/mailman-users/2014-February/076106.html>.
+
+Both versions work only with archives whose archive_volume_frequency
+is Monthly.

=== added file 'contrib/post_count'
--- contrib/post_count	1970-01-01 00:00:00 +0000
+++ contrib/post_count	2014-02-16 23:54:48 +0000
@@ -0,0 +1,39 @@
+# Show how much email sent through a mailman mail list
+# Copyright (c) Alain Williams <a...@phcomp.co.uk> January 2009
+# This program is free software and is licenced under the GPL: http://www.gnu.org/copyleft/gpl.html
+
+# Set the path to Mailman's private archives directory.
+# Adjust for your installation.
+ARCHIVES="/usr/local/mailman/archives/private"
+
+if [ "$1x" == "x" ] ; then
+	echo "Usage: $0 <list-name>"
+	exit
+fi
+
+cd $ARCHIVES/$1 || exit
+
+echo "Columns: month number-of-messages total-message-size"
+Months="January February March April May June July August September October November December"
+FilesTot=0
+
+# Work out starting year, look for something like: 2004-December
+startYear=$( ls -d [0-9][0-9][0-9][0-9]-* | sort | sed s/-.*// | head -1 )
+endYear=$( date '+%Y' )
+
+for year in $( seq $startYear $endYear  )
+do	echo "Year $year"
+	YearTot=0
+	for month in $Months
+	do
+		[[ ! -d $year-$month ]] && printf "$year $month\tnone\n" && continue
+		cd $year-$month || exit
+		files=$( ls -f [0-9]* | wc -l )
+		(( FilesTot += files ))
+		((  YearTot += files ))
+		printf "$year $month\t$files\t$( du -h | cut -f 1 )\n"
+		cd .. || exit
+	done
+	echo "Total for year $year: $YearTot"
+done
+echo "Emails total $FilesTot"

_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to