Page 1 of 1

Script To Speed Up Thunderbird By Reseting Its' Index Files

PostPosted: Oct 3rd, '12, 12:22
by digigold
Over time Thunderbird index files can get corrupted &/or bloated. This will slow TB down &/or create errors. I wrote the following script that searches for all existing index files and deletes them. The next time you start up Thunderbird new index files will be generated.

Line 1 finds all index files and lists them one per line in maildat.sh. *NOTE: Don't forget to change /home/dg/.thunderbird/ to /home/<your UN>/.thunderbird/
Lines 2 & 3 insert \ before every space and ' respectively. If you have folders that contain other special charactors needing a leading \ just add them between lines 3 & 4.
Line 4 inserts the proper command into all maildat.sh lines
Line 5 just runs maildat.sh

Code: Select all
find /home/dg/.thunderbird/ -name *msf | tee maildat.sh
sed -i 's/\ /\\\ /g' maildat.sh
sed -i "s/'/\\\'/g" maildat.sh
sed -i 's/\/home/rm\ -fv\ \/home/g' maildat.sh
./maildat.sh 2>&1

Re: Script To Speed Up Thunderbird By Reseting Its' Index Fi

PostPosted: Oct 3rd, '12, 15:00
by doktor5000
FWIW, how did you measure the corruption/bloat and the resulting speedup after reindexing everything?

Apart from that, it's much easier to force Thunderbird to reindex everything by just removing the index database file global-messages-db.sqlite
And if you want the speedup to be effective, make sure every folder is compacted regurlarly, and empty Junk and Trash folders regularly and compact them, too.
See http://kb.mozillazine.org/Compacting_folders and http://kb.mozillazine.org/Performance_%28Thunderbird%29 for other good hints.

And, the hint to make a backup from your thunderbird profile before trying such things would be welcome ;)


PS: Instead of using that script you propose, why not do it directly, like with
Code: Select all
find /home/dg/.thunderbird/ -name "*msf" -delete

or via
Code: Select all
find /home/dg/.thunderbird/ -name "*msf" -print0 | xargs -0 rm -fv

Re: Script To Speed Up Thunderbird By Reseting Its' Index Fi

PostPosted: Oct 4th, '12, 14:53
by digigold
doktor5000 wrote:...make a backup from your thunderbird profile before trying such things...

Always a good idea!

doktor5000 wrote:Instead of using that script you propose, why not do it directly, like with
Code: Select all
find /home/dg/.thunderbird/ -name "*msf" -delete

or via
Code: Select all
find /home/dg/.thunderbird/ -name "*msf" -print0 | xargs -0 rm -fv

Those would work as well. I did it w/the aforementioned script for two reasons. First, I prefer the extra verbosity provided, and second, I created the script by modifying one of my CL admin scrips. In other words I have several scripts that are very similar so minimal work was involved...and the script is called by other scripts I have created. Noteably, one that assists end-users w/common issues that I created way back in the day to reduce extranious trouble tickets. (I was managing a Help-Desk at the time.)