Re-index mailboxes
Re-index mailboxes
Is there a way to reindex ALL mailboxes on a server? I know you can reindex a single mailbox via the Admin interface, but we need to be able to reindex all of them on a server (several 100) and doing them one by one via the interface would be extremely painful!
Re-index mailboxes
I am running into an issue after a migration to a new mailbox server where we have a mailboxes that 'looses' messages. The fix seems to be reindexing a problem mailbox (as pointed to in other posts).
Has anyone found a way to re-index all mailboxes without completely burying my server's IO or having to do it by hand?
Has anyone found a way to re-index all mailboxes without completely burying my server's IO or having to do it by hand?
Re-index mailboxes
I just ended up creating a script called "reindex_mailboxes". Basically it is simply the following:
for i in `zmprov gaa -s `
do
echo "reindexing $i"
zmprov rim $i start
done
Whether that slams your I/O or not, I can't say that I've really noticed - though I only run it overnight.
for i in `zmprov gaa -s `
do
echo "reindexing $i"
zmprov rim $i start
done
Whether that slams your I/O or not, I can't say that I've really noticed - though I only run it overnight.
-
- Outstanding Member
- Posts: 769
- Joined: Fri Sep 12, 2014 10:23 pm
Re-index mailboxes
It can easily slam your disk and CPU i/o. I did the same, but I put a "sleep 120" between each one to space it out a bit. I didn't care how fast it got done, I just needed it to get done for all accounts, so I let that run in the background and it worked itself up without doing them all at the same time.
Re-index mailboxes
#!/bin/bash
# Get list of mail accounts and reindex each one
for i in `zmprov -l gaa -s server.yourdomain.com`
do
echo -n "Reindexing $i"
# Start reindexing
zmprov rim $i start >/dev/null
# Check if the rendix is still running for this account
while [ `zmprov rim $i status|wc -l` != 1 ]
do
# Sleep for 2 seconds before checking status again
echo -n . && sleep 2
done
echo .
done