How to clean mailman archives in cPanel

Posted: February 3, 2013 in Cpanel
You need to have root access to your server using SSH.
The commands required to clean the mailman archives and attachments disk space are:
1. To clean the old archives (keeping just the last 3 months):
cd /usr/local/cpanel/3rdparty/mailman/archives/private/
cd listname_clientdomain.ext
NOTE: replace listname_clientdomain.ext for your corresponding mailing list name and domain.
Then delete the files related to your list executing (as an example):
rm -fR 2009*
rm -fR 2010*
rm -fR 2011-Jan*
rm -fR 2011-Feb*
rm -fR 2011-Feb*
rm -fR 2011-Mar*
rm -fR 2011-Apr*
rm -fR 2011-May*
rm -fR 2011-Jun*
rm -fR 2011-Jul*
rm -fR 2011-Aug*
rm -fR 2011-Sep*
etc …
In the example above we deleted all the archived files for 2009, 2010 and all month until September 2011.
2. To clean the attachments (keeping just the last 3 months):
cd attachments
tmpwatch –mtime –all 744 /usr/local/cpanel/3rdparty/mailman/archives/private/listname_clientdomain.ext/attachments
NOTE: replace listname_clientdomain.ext for your corresponding mailing list name and domain.
3. To clean the cache for mailman once done the previous two steps please run:
/scripts/update_mailman_cache
So, you will see the right quota at the account disk space used.
That’s it.
Advertisements
Comments
  1. ddg says:

    Nice Post Dear !!! works fine for me.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s