Skip to Content.
Sympa Menu

en - Re: [sympa-users] Automatic List Cleanup

Subject: The mailing list for listmasters using Sympa

List archive

Chronological Thread  
  • From: David Verdin <address@concealed>
  • To: Wendell Epps <address@concealed>
  • Cc: "address@concealed" <address@concealed>
  • Subject: Re: [sympa-users] Automatic List Cleanup
  • Date: Tue, 06 Oct 2009 19:18:18 +0200

I can't think of any command that would help you doing that.
I'm afraid you'll have to script that.
Each list directory contains a "msg_count" file that stores basic information on each message sent by the list. Each line of this file contains two values:
-the first is an epoch date divided by 86400. It corresponds to a day number.
- the second is the number of messages sent to the list that day.

There are only entries for days when messages were actually sent. So just find the highest value, multiply it by 86400 and you'll have the latest epoch date when a message was sent to the list. You can find inspiration in the code of the do_get_inactive_lists function:

For each list, do:

my $last_message;

if (open COUNT, $list->{'dir'}.'/msg_count') {
while (<COUNT>) {
$last_message = $1 if (/^(\d+)\s/ && ($1 > $last_message));
}
close COUNT;

}else {
&wwslog('info', 'Could not open file %s', $list->{'dir'}.'/msg_count'); }


$last_message contains the highest value .

Then use the sympa.pl script with --close_list option.

and here you go !

Actually, giving you these guidelines makes me realize that it would be very easy to integrate such a feature in the Sympa distribution; Something else on the todo list, I guess...

Regards

David


Wendell Epps a écrit :
Hello,

I've been trying to find a way to automatically clean up some lists on our
Sympa servers. My team and I are in the process of setting up two new Sympa
servers, and before we migrate our lists from the old to the new, we'd like
to be able to clean up some of the older lists.

For example, we'd like to delete lists that may be older than 6 months and
have not been used at all, or the ones that have been used in the past, but
have been dormant for a long period of time. Would anyone have a helpful
script or something to assist us with that? I did a cleanup a few months
back, but that was all manual work. Any help would be appreciated.

Thank you.


----------------------------------------
Wendell Epps
Enterprise Messaging & Collaboration
IT@JH - Mt. Washington
e: address@concealed
p: 410.735.7353
----------------------------------------
 Please consider the environment before printing this e-mail.







Archive powered by MHonArc 2.6.19+.

Top of Page