Sunday, June 30, 2013

How to clean mailman archives 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.

 

1 comment:

  1. These backpacks usually come in various styles, colors, sizes and price tags.
    People who tend to overpack their personal effects are always caught up in this dilemma.

    If you have very large lenses, they probably won't fit, but for a couple of extra lenses, you can design the interior to hold your equipment.

    ReplyDelete