Automate Thunderbird email database backup

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

JohnWill

Thread Starter
Retired Moderator
Joined
Oct 19, 2002
Messages
106,726
I'm trying to set up an automated backup of my Thunderbird database using my chosen backup program Beyond Compare. With that in mind, I've created a small batch file that shuts down Thunderbird, runs the backup application to create the snapshot, and then starts up Thunderbird again.

If I just run this batch job from a command prompt, it works perfectly. The batch shuts down TB, I get my backup data copy, and then the batch restarts TB.
I can run this batch job multiple times and it succeeds every time and works perfectly.

Now I just invoke the batch job from Windows 10's Task Scheduler and things go south. The TB shutdown and backup go fine, and the batch job starts up TB. TB appears in the task scheduler window, but I never get the window, and I have to open Task Manager and kill the copy of TB and manually start it to get the desktop window back.

Can anyone tell me what is happening and how to make this automation work?

Contents of my batch file.

@Echo off
for /l %%x in (1, 1, 10) do (
rem echo Loop iteration count %%x
taskkill /im thunderbird.exe
)
taskkill /f /im thunderbird.exe
timeout 10
start "" "C:\Program Files\Beyond Compare 4\BCompare.exe" "@D:\BC_Sync\Thunderbird Snapshot to H.txt" /wait
timeout 10
start "" "C:\Program Files (x86)\Mozilla Thunderbird\thunderbird.exe"



TB Appears in my task list, just doesn't actually product the desktop window!

TB in Task List.png
 
Joined
Sep 21, 2007
Messages
14,566
Try taking out the TB restart at the last line and make it a Task Scheduler task separately.
 
Joined
Sep 21, 2007
Messages
14,566
Perhaps try a separate scheduled task without the "start", just using the TB path alone.
 

JohnWill

Thread Starter
Retired Moderator
Joined
Oct 19, 2002
Messages
106,726
I did fire it off without the start, by itself in a task it doesn't get a window. I suspect that running it with task manager is the issue, but I'm not sure how to change that.
 

Xsage

Dave
Joined
Jan 8, 2016
Messages
343
I tried to replicate this whole process using Thunder Bird and Beyond Compare 4 in my sandbox and it works fine using task scheduler, which means it is likely a setting in your environment/task scheduler.

The only time I can replicate your issue, is if I try to run the task as a different user to the one I'm logged in to. When I do this, Thunder Bird shows up in Task Manager under"Background Process" rather than "Apps". Could this be the same problem you are facing?
 

JohnWill

Thread Starter
Retired Moderator
Joined
Oct 19, 2002
Messages
106,726
Well, that's what is happening, but I'm running it under my logged in user ID and password. I actually looked around to see if there was a setting in Task Manager that I was missing, but I sure can't find anything. I believe you're right as when I run the batch file, I see the BC backup happening, but I don't see anything when task manager runs it.

When I look at how the execution is invoked in Task Manager, I can't see anything that I can change to make this happen.
 

Attachments

Xsage

Dave
Joined
Jan 8, 2016
Messages
343
Ah, I was midway typing a response asking you to check those setting there :p

Is that all working as it should now then? or are there still issues you need ironing out?
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top