[Mailman-Users] problem about a statistic script

liste yoneticisi listeyon at metu.edu.tr
Fri Aug 25 13:10:27 CEST 2006


Hello;

I've modified the following script in order to get monthly statistics
including list owner column.

original script:
---------------------
#!/bin/bash

MONTH=`date +'%b'`
MAILMANDIR=/cwis/htdocs/mailman
POSTLOG=$MAILMANDIR/logs/post
LISTLISTS=$MAILMANDIR/bin/list_lists
LISTMEMBERS=$MAILMANDIR/bin/list_members
echo "Listname  Posts   Members"
echo "========================="

for list in `$LISTLISTS | grep -v "matching mailing lists found" | awk '{print $1}'`
do
    postnum=`grep "^$MONTH" $POSTLOG | grep -i "post to $list" | wc -l`
    membernum=`$LISTMEMBERS $list | wc -l`
   echo $list " | " $postnum " | " $membernum
done
-------------- (it works perfectly)

I've added owner related lines and the script became to be as following:

modified script:
#!/bin/bash

MONTH=`date +'%b'`
MAILMANDIR=/cwis/htdocs/mailman
POSTLOG=$MAILMANDIR/logs/post
LISTLISTS=$MAILMANDIR/bin/list_lists
LISTMEMBERS=$MAILMANDIR/bin/list_members
LISTOWNERS=$MAILMANDIR/bin/list_owners
echo "Listname  Posts   Members"
echo "========================="

for list in `$LISTLISTS | grep -v "matching mailing lists found" | awk '{print $1}'`
do
    ownlist=`$LISTOWNERS $list | head -1`
    postnum=`grep "^$MONTH" $POSTLOG | grep -i "post to $list" | wc -l`
    membernum=`$LISTMEMBERS $list | wc -l`
    echo $list " | " $ownlist " | " $postnum " | " $membernum
done

-------------
only addition is the path of "list_owners" command and ownlist variable
calling this command.

But the script gives the following lines.
"
Traceback (most recent call last):
  File "/cwis/htdocs/mailman/bin/list_owners", line 120, in ?
    main()
  File "/cwis/htdocs/mailman/bin/list_owners", line 91, in main
    mlist = MailList(listname, lock=0)
  File "/cwis/htdocs/mailman/Mailman/MailList.py", line 130, in __init__
    self.Load()
  File "/cwis/htdocs/mailman/Mailman/MailList.py", line 615, in Load
    raise Errors.MMUnknownListError
Mailman.Errors.MMUnknownListError
"
The is about ~250 lists in the system and the result probably will be
repeated 250 times if i wont kill the command.

how can i solve the problem?
Tank you for your answers.
Regads.
Evrim AKMAN
Computer Center METU



More information about the Mailman-Users mailing list