[Now Implemented!] Btsync As A Windows Service


upcboy

Recommended Posts

I am not sure if this has been requested yet, but it would be nice if the sync client would stay connected after logging out of operating system.

Basically having it run as a system service that is always on, like having RealVNC always running regardless of anyone being logged in or not. I think that would be a great idea.

In the meantime you could probably set up a scheduled task to automatically run upon windows bootup, you would have zero control over it but it would be resident.

Link to comment
Share on other sites

Instead of trying to start BTSync as Service, you can run it as scheduled task on system startup.

I do this with all applications that don't support running as service and it worked for all I've tested so far. It's much simpler than messing around with srvany.

You can start/stop with schtasks.exe, configure it to restart on failure...

Actually I don't see a need to run as service anymore ;)

@affinity

it is, just create two tasks and select different users in the "run as" tab. You will have to log on with these users once to initially setup BTSync

Link to comment
Share on other sites

Would it be possible to have two instances running on the same machine with different user login credentials?

That's exactly the way I use in Linux versions installed with the new DEB packages. There is the possibility to run more than one btsync instance by spcifying more than one configuration file. Since BTsync provides no direct way to specify the credential it runs under, in Linux I supply this information using the naming of the configuration files (e.g. /etc/btsync/myconfig.leo.json). In windows you can create more than one service running under different credentials (you have only to name each service with a different name). The only problem is probably that btsync for windows gets his configuration from the registry. If btsync uses the HKEY_LOCA_MACHINE registry hive (that should not be allowed for user-software, since it requires administrator rights to write there), there is no chance, but probably btsync will handle it correctly by using the HKEY_USERS hive and keeping the configuration separated for each user. This would permit you to install one instance of a service per user since each user has its own configuration storage.

Link to comment
Share on other sites

using the "server install", i have a little problem :

when i set up a new folder in BTSync, it's always "forgoted" when i close the session on the server, but the service is still running...

i already have 5 folders shared in BTSync without any problems and i can't add another one...

i thing that it's important to make a real server install in the setup because the one in this post is not very "stable".

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

I was able to get this working much easier using nssm. http://nssm.cc/usage

  • Install BTSync
  • Configure your shared folders
  • Make sure you uncheck the "Start btsync when windows starts" option in the preferences.
  • Download nssm, as an admin run "nssm install BTSync"
  • Put in the path to the BTSync.exe
  • Open windows service manager and tell it to run BTSync as the user you just used to install.
  • Make sure BTSync isn't already running, then start the service.

Link to comment
Share on other sites

The problem with running it as a task (and probably also as a service) is that you don't see the interface anymore. It would be better to have this implemented properly, i.e. with a background service that does the work and a GUI app that talks to the service.

Link to comment
Share on other sites

That's exactly the way I use in Linux versions installed with the new DEB packages. There is the possibility to run more than one btsync instance by spcifying more than one configuration file. Since BTsync provides no direct way to specify the credential it runs under, in Linux I supply this information using the naming of the configuration files (e.g. /etc/btsync/myconfig.leo.json). In windows you can create more than one service running under different credentials (you have only to name each service with a different name). The only problem is probably that btsync for windows gets his configuration from the registry. If btsync uses the HKEY_LOCA_MACHINE registry hive (that should not be allowed for user-software, since it requires administrator rights to write there), there is no chance, but probably btsync will handle it correctly by using the HKEY_USERS hive and keeping the configuration separated for each user. This would permit you to install one instance of a service per user since each user has its own configuration storage.

I've had massive success by using Docker and BTSync. With it I'm able to spawn my clients own BTSync instance that they're able to fully control.

Link to comment
Share on other sites

I used to the build-in "SC.exe" utility from Windows to create a service from the bittorent client.

But this doesnt seem to work, since the service wouldnt start due to "Error 1053"

So I'll try the first method mentioned in this forum

Link to comment
Share on other sites

  • 2 weeks later...
  • 3 weeks later...

After reading through this I am a bit confused. What is the best way to run Sync at startup? I have one computer that auto starts and I would like it to sync without having anyone logged into it. Currently I have it as a scheduled task, but I also have the start when Windows starts option checked as well. If the task is already running and it is called again, does that not just call up the GUI or am I inviting problems with a double start?

Link to comment
Share on other sites

After reading through this I am a bit confused. What is the best way to run Sync at startup?

The "best way" is to wait until the ability to install/run Sync as a Windows Service is natively implemented by the developers - it is coming!

If the task is already running and it is called again, does that not just call up the GUI or am I inviting problems with a double start?

Sync won't allow you to run multiple instances - if Sync is running, and you attempt to start a second copy, you'll get the error "It seems like BitTorrent Sync is already running, but not responding. Please close all BitTorrent Sync processes and try again"

Link to comment
Share on other sites

Well, right now it starts as a task without being logged in. And when I login, it re-indexes and syncs all over again, but at lease the files have already transferred.

If I uncheck the start with Windows option, I do not see BTSync at all and have to opening it manually to see what is going on. Sometimes I get the error, sometimes not... Oh also any timeframe on BTSync as a service?

Link to comment
Share on other sites

I second the request for a server install as I have this running on a WHS 2011 (2008R2 cut down) and a server 2003R2 at work and currently not had much luck in running as a service/task on either machines so leave them both logged in. Home one not an issue but the work one is a bit of an issue as others log it out. and the reason I run this at work as I am only in the office one day a week and RDC through the VNC is hard work. Any ideal on timings would be great and might save a lot of time trying to get this to run. Keep up the great work as this software is great. And I have over 500GB now being sync'd to one machine from 7 others. plus syncing work folders around the world for my sales team. I would pay for this but love the fact it's free.

Link to comment
Share on other sites

Bumpty bump - The latest version of BTSync is spectacular, I'm even going so far as to drop my team dropbox account. I'm using a dedicated server as an additional node (to ensure 'offline/quiet-time/single-user' sync). I'm using NSSM to run it as a service, but (as noted earlier), there's no interface.

I'm using a backup utility on a third node to enable 'revisions' - which is a great feature you might want to consider in the near future. Basically what Dropbox call 'pack-rat' https://www.dropbox.com/help/113/en

Any word on a timeline for the service feature?

Cheers,

Frank.

Link to comment
Share on other sites

I'm running 1.1.42 on 2003 small business server and so far it seems to be working OK, am I missing something?

I'm no server expert.

The issue is that currently Sync doesn't install and run as a Windows service, and therefore will only run when you're actually logged on to your computer/workstation (and when your computer/workstation is "locked"). If you physically "logoff", Sync will shut down, it doesn't keep running in the background!

Link to comment
Share on other sites

Wishlist:

Definite: To run as a Service on Windows (Server 2003 onwards)

We currently start BTSync on Windows with a scheduled task to run when the system starts. This works and makes BTSync run in background, but it is not easily possible to access the GUI, or make changes.

Great piece of software though!

Link to comment
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.