Script To Speed Up Thunderbird By Reseting Its' Index Files

Here you'll find a place for solutions and hints.

Please use one of the support subforums below for questions or if you have any issues and need support.

Script To Speed Up Thunderbird By Reseting Its' Index Files

Postby digigold » Oct 3rd, '12, 12:22

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
"A mind that is stretched by a new experience can never go back to its old dimensions."
~Oliver Wendell Holmes, Jr.
User avatar
digigold
 
Posts: 150
Joined: May 9th, '12, 14:50
Location: Northern U.S.

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

Postby doktor5000 » Oct 3rd, '12, 15:00

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
Cauldron is not for the faint of heart!
Caution: Hot, bubbling magic inside. May explode or cook your kittens!
----
Disclaimer: Beware of allergic reactions in answer to unconstructive complaint-type posts
User avatar
doktor5000
 
Posts: 17659
Joined: Jun 4th, '11, 10:10
Location: Leipzig, Germany

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

Postby digigold » Oct 4th, '12, 14:53

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.)
"A mind that is stretched by a new experience can never go back to its old dimensions."
~Oliver Wendell Holmes, Jr.
User avatar
digigold
 
Posts: 150
Joined: May 9th, '12, 14:50
Location: Northern U.S.


Return to The magician suggests...

Who is online

Users browsing this forum: No registered users and 1 guest

cron