how to clean mailman archives in cPanel

tecnotronico

Active Member
Apr 17, 2004
28
1
153
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.
 
  • Like
Reactions: BluesBrother