Mozilla Thunderbird is a free email application. MozBackup is a utility for creating backups of Thunderbird and other Mozilla applications. It can backup and restore everything from your bookmarks, history, plugins, mail, to contacts. MozBackup offers command line functionality which supposedly allows for command line backups, however, I have encountered it to loop repeatedly, and endlessly. Backing up a profile, deleting it, then recreating it. With a tool called AutoIt, I have created a script which uses MozBackup, that works for me towards a complete automated solution.
Instead of invoking the command line functionality of MozBackup, this script uses the GUI interface and basically makes all of the selections automatically. By creating the script, and making an automated task, i now have an automated solution to backup Thunderbird email profile.
The script. The functions are not my originals, I found them on the net sometime ago, but they were used to shutdown the process gracefully.
#Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=AutoThunderbirdBackup.Exe #AutoIt3Wrapper_Compression=4 #AutoIt3Wrapper_UseUpx=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstants.au3> ;Gracefully shutdown Mozilla Thunderbird ;Sometimes fails, so do this twice ProcessQuit("thunderbird.exe") Sleep(5000) ; Sleep for 5 seconds ProcessQuit("thunderbird.exe") Sleep(5000) ; Sleep for 5 seconds ;Run MozBackup 1.5.1 Run('C:\Program Files (x86)\MozBackup\MozBackup.exe') WinWaitActive("MozBackup 1.5.1 - Welcome","") Send("{ENTER}{DOWN}{ENTER}{ENTER}{TAB}{ENTER}{ENTER}") WinWaitActive("MozBackup 1.5.1 - Report","") Send("{ENTER}") ;WARNING: Runs in an endless loop. ;Run('"C:\Program Files (x86)\MozBackup\MozBackup.exe" "C:\Program Files (x86)\MozBackup\Default_my.mozprofile"') Exit Func ProcessGetWindows($PId) $PId = ProcessExists($PId) If $PId = 0 Then SetError(1) Else Local $WinList = WinList() Local $WindowTitle[1][2] Local $x = 0 For $i = 1 To $WinList[0][0] If WinGetProcess($WinList[$i][1], "") = $PId And $WinList[$i][0] <> "" Then ReDim $WindowTitle[$x + 1][2] $WindowTitle[$x][0] = $WinList[$i][0] $WindowTitle[$x][1] = $WinList[$i][1] $x += 1 EndIf Next Return $WindowTitle EndIf EndFunc ;==>ProcessGetWindows Func ProcessQuit($filename) $Return = 0 $a = ProcessList($filename) For $i = 1 To UBound($a) - 1 $Return = ProcessGetWindows($a[$i][1]) Next If ($Return == 0) Then Return EndIf DllCall("User32.dll", "int", "PostMessageA", "hwnd", $Return[0][1], "int", $WM_QUIT, "int", "", "int", "") EndFunc ;==>ProcessQuit