LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-30-2014, 04:46 PM   #1
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,601

Rep: Reputation: 189Reputation: 189
Automated Thunderbird Addressbook Export


I recently had Thunderbird manage to corrupt its configuration. I think it occurred during situation where /home went to 100% utilization but I'll probably never know for sure. Recreating my email account settings was simple enough. The thing that was the most annoying part of the recovery was my address books. I found a months-old LDIF file that contained most of the addresses but I have had to (still not finished) add some back in manually after locating emails (on our IMAP server) and grepping for "From:" fields (for example).

What I'd like to do is find a way to automatically do an export of the address book using a script running under cron. I would think that having the most recent N days exports would suffice to allow a recovery from any future corruption to completely eliminate -- or nearly so -- the manually recovery I'm doing today. Trouble is that I can't seem to find any Thunderbird command line options that will do this. I rarely run Mozilla applications from the command line so I was really hoping to find that something like
Code:
thunderbird --export <addressbook-name>
was available. Sadly, it isn't.

I've found references to an older tool -- a plug-in called SyncMab -- that was allegedly useful. It sure looked like something I could use for what I'm looking to do but it seems to be incompatible with recent versions of Thunderbird.

I'm trying out an Add-On called ThunderSync but have no idea if it's doing what it claims to do. I've configured it -- I think -- to export when shutting TB down but I see no files that appear to have been created at the time I exited TB.

BTW, I've run across several posts on the Mozilla forums where someone posted a request whether this feature was available and the respondents were rather^Wvery hostile: "idiot! why aren't you backing up every day" (even if they are who really wants to wade through N terabytes of backups to find one simple file), "find a 3rd party LDAP server to host your address book", "none of the other mail clients do this so why do you need it?" (that one kills me), etc. I'm not much in the mood to put up with those types so I'm asking here. (LQ attracts a more civilized user.)

Any ideas? Or is it a hopeless pipe dream to be able to save one small dataset?

I'm not married to Thunderbird so if there's a mail client that makes this easy, I'm all ears. Note: I'm not all that interested in Evolution (or much of anything having to do with Gnome) or Kmail. I like both of them but they require so much other software -- especially Kmail with all the akonadi crud it "needs" -- that I'd prefer something a bit more lightweight.

Any ideas welcomed.

TIA...

--
Rick
 
Old 10-30-2014, 08:02 PM   #2
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 281Reputation: 281Reputation: 281
The addressbook is stored in your profile folder. Why not just back that up with a cron job? That's what Mozilla recommends.
 
Old 10-31-2014, 10:57 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rnturn View Post
Any ideas? Or is it a hopeless pipe dream to be able to save one small dataset?
Rick:
The personal address book is called abook.mab while the collected addresses address book is called history.mab.

The easiest way by far, is to backup the entirety of ~/.thunderbird.
 
Old 10-31-2014, 06:19 PM   #4
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,601

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by sgosnell View Post
The addressbook is stored in your profile folder. Why not just back that up with a cron job?
That would work. Currently, though, "du -sk *" of the contents of my ".thunderbird" directory shows that my profile subdirectory holds well over 500MB. I'm not keen on backing all that up every day -- I'll probably want to keep a few days worth of the backups. The vast majority of that data in that tree is under "ImapMail", apparently, for use "offline" though I cannot recall ever enabling -- and likely would never use -- that feature. Synchronization is disabled, but the size might represent emails that were "synced" prior to my disabling synchronization.

I've been able to get it cleaned out. Now I just need to keep it that way. Something tells me that trying to keep any backup to a small size by omitting the ImapMail subdirectory tree from a backup will only cause headaches and `colorful' language later.

I have an old script that'll be adapted to make a compressed archive of the profile directory and round-robin it amongst "N" archive locations (currently N=7 in the script and is set to day-of-the-week from "date +%w").

Of course, my next question is which files would one have to copy from the archived profile directory to recover the address book... and only the address book? The file "abook.mab" doesn't seem to contain anything that looks like addresses so the actual contacts must be stashed in another file. I fear that I'm going to find out that I'll need to recover some file that contains a conglomeration of other information that I might not want to recover as it'll overwrite something that I don't need or want to clobber.

This all seems like overkill when all one would really like is a safe copy of their contacts. Just my $0.02...

--
Rick
 
Old 10-31-2014, 06:50 PM   #5
EYo
Member
 
Registered: Jun 2009
Location: Cloverdale, northern california
Distribution: Slackware 14.2
Posts: 182

Rep: Reputation: 150Reputation: 150
Quote:
Originally Posted by rnturn View Post
I fear that I'm going to find out that I'll need to recover some file
The "some file" is what Habitual said, history.mab.
http://kb.mozillazine.org/Moving_add...tween_profiles , has recovery info too, HTH.
 
Old 10-31-2014, 07:03 PM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by rnturn View Post
over 500MB. I'm not keen on backing all that up every day
Rick. One word: rsync
It will only backup files that have changed, not everything all the time, except the first time you run this it will take all > 500MB, but successive runs, it will only rsync the changed files.

Code:
#!/bin/bash
ionice -c 3 rsync -vaz /home/rick/.thunderbird /path/to/backup/media/ --delete

Last edited by Habitual; 10-31-2014 at 07:04 PM.
 
Old 10-31-2014, 07:26 PM   #7
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,601

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
Originally Posted by Habitual View Post
Rick. One word: rsync
It will only backup files that have changed, not everything all the time, except the first time you run this it will take all > 500MB, but successive runs, it will only rsync the changed files.
That works but, unless I'm missing something, rsync is not going to know the difference between a legitimately changed file and a corrupted file so the resulting backup won't be terribly useful. I figure that keeping a week's worth should give me time to figure out when things stopped working correctly and allow a recovery from the backup the day before the corruption took place.

Still need to know what to recover, though.

--
Rick
 
Old 11-01-2014, 09:28 AM   #8
rnturn
Senior Member
 
Registered: Jan 2003
Location: Illinois (SW Chicago 'burbs)
Distribution: Currently: openSuSE, Raspian, Slackware. Formerly: CentOS, MacOS, Red Hat. Other: Solaris, Tru64
Posts: 1,601

Original Poster
Rep: Reputation: 189Reputation: 189
Quote:
The personal address book is called abook.mab while the collected addresses address book is called history.mab.
I take that the 'mab' file extension stands for Mozilla Address Book?

So all I'd really need is those two files. Nothing addressbook/contacts-related hiding within another file? If so, then that's the ticket. And it neatly solves the large ImapMail tree backup problem.

[Note: going a little off-topic] I tried copying those two files onto my laptop (after making backup copies of the originals, of course) and found I had duplicated my desktop system's contact list very nicely. I'm not sure if that's any easier than going the LDIF export file route but nice to know it's a possible way to recover from a complete disaster should no export file be available. (Of course, it only works as a means of copying that information to another Thunderbird instance.)

Thanks for the tip.

--
Rick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i get my 'thunderbird' addressbook into an 'evolution' format? kline Linux - Software 1 03-10-2012 11:32 PM
tried to save addressbook in Thunderbird but..... Birdman48 Linux - Newbie 6 01-12-2012 12:29 AM
[SOLVED] Thunderbird Addressbook with OpenLDAP ridingthestorm Linux - Server 3 08-12-2011 05:27 PM
Importing, mail, addressbook into Thunderbird mickeyboa Fedora 3 05-14-2008 05:40 AM
How to export mails and addressbook form Netscape 6 or 7 Sim_one80 Linux - Software 0 11-05-2004 03:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration