Sign in to follow this  
noiime

Running Bts From A Schedule Task

Recommended Posts

Hi,

Because of the poor network equipment that is on-site, we got 11 sites that needs BTS to be running out of a schedule.

Those sites needs BTS to be close during business hours.

 

When I first set-up the schedule task, all of them were functional but after a while, some of them begin to do a strange behavior.

 

In fact, 6 out of 11 aren't working anymore.

 

When BTS start, triggered by the schedule task, one of the share folder is showing this error:

" Error: BitTorrent Sync cannot identify the destination folder"

 

If I start BTS manually, everything is fine.

 

4/6 are Windows 8 Pro

2/6 are Windows 2008 R2

BTS version 1.2.82 & 1.2.87

The folder that isn't working is a mapped network drive

 

I've already tried running BTS out of a batch file within the schedule task and it didn't work.

Same behavior, BTS start but that particular shared folder isn't working.

** Note that when I run the batch file manually it work great.

 

I also get this error in the task scheduler: 0x80070001

I did googled it and I didn't find any solution that is working with BTS

 

With BTS 1.2.82 I got this in the log

 

[2014-03-03 10:14:28.491] Loading config file version 1.2.82
[2014-03-03 10:14:28.554] SyncDb: Failed to init db - 4618
[2014-03-03 10:14:28.554] Loaded folder \\?\C:\000QAM_APPS
[2014-03-03 10:14:28.569] SyncDb: Failed to init db - 4618
[2014-03-03 10:14:28.569] Loaded folder \\?\T:
[2014-03-03 10:14:34.132] SyncDb: failed to prepare statement to query metadata - 4618
[2014-03-03 10:14:37.007] SyncDb: failed to prepare statement to query metadata - 4618
[2014-03-03 10:14:37.038] SyncDb: failed to prepare statement to query metadata - 4618
[2014-03-03 10:14:37.132] SyncDb: failed to prepare statement to query metadata - 4618
[2014-03-03 10:14:37.148] SyncDb: failed to prepare statement to query metadata - 4618
[2014-03-03 10:14:37.179] SyncDb: failed to prepare statement to query metadata - 4618

 

With 1.2.87, there's nothing special in the log file even with the debug enable

I've tried every possible options in the task scheduler but nothing seems to work.

 

Any idea's would be appreciated

Tx

 

 

Share this post


Link to post
Share on other sites

If it works when you run your "batch" file manually, but not when the batch file runs on a schedule, it's highly likely to be that the account under which the batch file runs on a schedule does not have enough permissions to either access the folder you're trying to sync (hence the "BitTorrent Sync cannot identify the destination folder" error), or to access %AppData%/BitTorrent Sync (hence the "Failed to init db" error).

 

If it "sometimes" runs on a schedule, but not others, it's likely that your scheduled task is set to run using the credentials of the currently logged in user. Therefore, if a different user happens to be logged in, the task will run under a different set of credentials (see above)

 

There's also some additional info on the "BitTorrent Sync cannot identify the destination folder" error in the Unofficial FAQ

 

Finally, it's also advisable to ensure that all your devices are running the same version of Sync, rather than a mixture of versions.

Share this post


Link to post
Share on other sites

Thanks for the answer!

 

I am logged in using Administrator and there's no other user that can log in to those server.

The schedule task is set to use the administrator credential to run the task

 

Full permission to this account is already in place for these following folder:

- T:\ *** the folder that is problematic

- C:\Program Files (x86)\BitTorrent Sync

- C:\Users\Administrator\AppData\Roaming\BitTorrent Sync

 

What is bothering me is that it was working for like a month before it begin popping up those errors...

Weird... probably due to a Windows updates of some sort :angry:

 

Anyway, when I find out the solution I will post it here.

If someone have any idea feel free to post it, any help is always appreciated!

Tx

Share this post


Link to post
Share on other sites
Guest proactiveservices

If you can't get your method of running/quitting BTSync to work, you could use netsh to add and remove firewall rules for BTSync at the given time.

Share this post


Link to post
Share on other sites

hum, you are right!

I should have thought about this approach!! :mellow:

 

Just because it is bothering me I will still try to fix this.

But if I'm unable to resolve the puzzle, for sure I will use netsh !

 

Thanks a lot for the tips!!

Share this post


Link to post
Share on other sites

Full permission to this account is already in place for these following folder:

- T:\ *** the folder that is problematic

- C:\Program Files (x86)\BitTorrent Sync

- C:\Users\Administrator\AppData\Roaming\BitTorrent Sync

Does your T:\ drive have "Recycled" and/or "System Volume Information" folders? Sync cannot access these System folders, as so trying to sync such folders can cause issues. For this reason, it is not advisable to Sync an entire drive (I'm assuming here that T:\ is an entire drive, rather than just a single location you've mapped to that particular drive letter?)

Share this post


Link to post
Share on other sites

GreatMarko,

I knew about that issue so I already check for those folder and there's none of them.

BTW thanks for your excellent support in this forum

 

If fact the problem was not with btsync/schedule task it was about schedule task/network mapped drive.

I found out the solution and it was soooooo easy, it was in my face right from the beginning!

 

In BTS instead of using the mapped letter, in my case "T:\", I used the direct path to the share.

And "Voilà", it's fixed!!

 

I still don't know why it was working at first tough!!?

:wacko:

Share this post


Link to post
Share on other sites
Guest proactiveservices

Ahhh...I wonder if you had entered network credentials that were forgotten when the system was rebooted. Those times have got me in the past. You leave it all working then one day...boom! If the system rebooted for the Windows Updates, this will have lost any temporary credentials.

Share this post


Link to post
Share on other sites

Proactiveservices,

That was my first guess but, even right after recreating the schedule task with all the credential, it wouldn't work anymore.

So that wasn't it.

 

What I didn't know is that apparently Windows have a lot of issue regarding schedule task vs mapped drive.

As I understand it, sometimes it work sometimes it don't.

 

Most of the solutions involve un-mapping / remapping the drive before running X application in relation with a mapped drive.

 

Instead, I thought is was more elegant to change the sync folder T:\ in BTS for the direct network path :rolleyes:

Work like a charm and it doesn't need the intervention of another application like "net use"

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this