Debian And Ubuntu Server Unofficial Packages For Bittorrent Sync


Recommended Posts

I have issues when bittorrent sync syncs from one machine to the next. It changes permissions so that I can't save anything and I have to go in and manually change the permissions back. I'm sure this is in a config somewhere.

Ā 

I'd like to change two things about this. I'd like to change the user to a different user (not user name for the login, but the user who owns the folders) the user is currently set to btsync. I'd also like to change the group permission. The group permission is currently set to Group can Read and I'd like to change to Group can Read/Write.

Ā 

Where do I need to look for the config and what settings would that be?

Ā 

Thanks!

Ā 

There are settings for both of these: during the first installation, debconf asks for the most important settings needed to install the daemon. If you perform a service reconfiguration, debconf asks for all available settings. If you perform a reconfiguration with

Ā 

sudo dpkg-reconfigure btsync

Ā 

you will be asked for the credentials and there you can specify both a user and a group of your choice for the btsync daemon. Additionally you will be asked also for a UMASK for the daemon. This setting determines with which mask files are created and written. In order to make all files and directories group writable, you have to specify 0002

Ā 

One question: are you sure, that the server packages are the rights ones for your use case? If your Linux machines are used as regular desktop machines with a user that interactively logs in and wants to synchronise directories owned by himself, maybe the packages for desktop usage btsync-user may be more suitable for you.Ā 

Link to comment
Share on other sites

There are settings for both of these: during the first installation, debconf asks for the most important settings needed to install the daemon. If you perform a service reconfiguration, debconf asks for all available settings. If you perform a reconfiguration with

sudo dpkg-reconfigure btsync

you will be asked for the credentials and there you can specify both a user and a group of your choice for the btsync daemon. Additionally you will be asked also for a UMASK for the daemon. This setting determines with which mask files are created and written. In order to make all files and directories group writable, you have to specify 0002

Ā 

One question: are you sure, that the server packages are the rights ones for your use case? If your Linux machines are used as regular desktop machines with a user that interactively logs in and wants to synchronise directories owned by himself, maybe the packages for desktop usage btsync-user may be more suitable for you.Ā 

Ā 

1. Thanks for the info!

Ā 

2. As to server vs user. I did try using the user install at some time past (it was quite a while back) and I had issues getting it to work. I just never tried it again. TBH, I could have even botched the installation so who knows.

Link to comment
Share on other sites

I've installed BTSync on my RPi with RaspBMC solely for syncing camera rolls for my iPad, and mine and my wife's iPhones. Ā That said I have the folders additionally syncing to my MBPr and Dell Inspiron Win 7. Ā The purpose is to sync mobile devices when ever and then others populate whenever they are up and in use. Ā For a few weeks, it worked flawlessly, and then weird stuff happened. Ā A few details on the setup at the bottom if it matters. Ā For the past month sometimes it works great, sometimes not so much. Ā Randomly when the Pi syncs, it's 0.0 kB/s, other times very slow (not indexing related) at 50 kB/s or below and sometimes totally normal at over 750 kB/s. Ā Sometimes my devices don't connect at all. Ā Any help is appreciated with ideas.

Ā 

Other notes on my setup: Ā 

Ā 

-Pi Model B 512MB

-RaspBMC up-to-date

-BTSync 1.2.82

-I changed indexing to 86400 sec (one/day)

-RPi is a static IP in my LAN

-Internally UPnP is enabled

Link to comment
Share on other sites

I've installed BTSync on my RPi with RaspBMC solely for syncing camera rolls for my iPad, and mine and my wife's iPhones. Ā That said I have the folders additionally syncing to my MBPr and Dell Inspiron Win 7. Ā The purpose is to sync mobile devices when ever and then others populate whenever they are up and in use. Ā For a few weeks, it worked flawlessly, and then weird stuff happened. Ā A few details on the setup at the bottom if it matters. Ā For the past month sometimes it works great, sometimes not so much. Ā Randomly when the Pi syncs, it's 0.0 kB/s, other times very slow (not indexing related) at 50 kB/s or below and sometimes totally normal at over 750 kB/s. Ā Sometimes my devices don't connect at all. Ā Any help is appreciated with ideas.

Ā 

Other notes on my setup: Ā 

Ā 

-Pi Model B 512MB

-RaspBMC up-to-date

-BTSync 1.2.82

-I changed indexing to 86400 sec (one/day)

-RPi is a static IP in my LAN

-Internally UPnP is enabled

Ā 

Your description of the problem, indicates that the problem is more related to the BitTorrent Sync core itself as to the Debian packaging. Perhaps it is a good idea to post the problem as a separate topic in the forum.

Link to comment
Share on other sites

  • 2 weeks later...

I am trying to find out if the following setup will work to make btsync work in a similar way to Dropbox. I have a personal laptop, a mobile phone, a tablet and, at the office, a work computer. The problem is that there is no guarantee that at any point of time any of these devices will be running and connected. With Dropbox syncing works because there is a central server that stores the files to be synced so the next time any of the devices connects to Dropbox it get synced to the latest. In addition to the above list I also have a headless Ubuntu server that is on and online 24x7. I was thinking to add this sever to the sync pool so that it will be guaranteed that at least this machine will have an up-to-date copy of the files and all other devices/computers will sync with it when they come on-line.

Ā 

1. Would this work?

Ā 

2. I tried to do this in my configuration and while it was very simple to setup my Ubuntu laptop and mobile phone to sync to each other, for the life of me I cannot get the server to join the syncing party. In my server configuration I am trying to setup a user configuration rather than the default one. The secret is the same in all instances.

Ā 

Ā 

Here is what I tried to do on the server after installing the server version:

Ā 

configuration file (avi.conf):


//!/usr/lib/btsync/btsync-daemon --config//// DAEMON_UID=avi// DAEMON_GID=avi// DAEMON_DEBUG=0000{"device_name": "coral - Avi","storage_path" : "/home/avi/.btsync","listening_port" : 0,"check_for_updates" : false,"use_upnp" : true,"download_limit" : 0,"upload_limit" : 0,"disk_low_priority" : true,"lan_encrypt_data" : true,"lan_use_tcp" : false,"rate_limit_local_peers" : false,"folder_rescan_interval" : 600,"webui" :{},        "shared_folders" :        [                {"secret" : "XXXXXXXXXXXXXXXXXXXXXX","dir" : "/home/avi/bitTorrent_Sync","use_relay_server" : true,"use_dht" : false,"search_lan" : true,"use_sync_trash" : true                }        ]}
Ā 

Ā 

Edited by le_avion
Link to comment
Share on other sites

1. Would this work?

Yes. I have a very similar configuration on my server.

Ā 

2. I tried to do this in my configuration and while it was very simple to setup my Ubuntu laptop and mobile phone to sync to each other, for the life of me I cannot get the server to join the syncing party. In my server configuration I am trying to setup a user configuration rather than the default one. The secret is the same in all instances.

Here is what I tried to do on the server after installing the server version:

Apparently I can't see anything wrong in your configuration file. But you must make sure, that the firewall of the server does not block the required connections. Since you have no chance to see anything, I would suggest to make a backup copy of your configuration file, remove completely the shared_folders section and activate the web UI in order to get a better overview of what is happening (you shared folder will still exist, since btsync has stored it into its internal database). After you solved your problem, you can deactivate the web UI and write the shared_folders section back.

Ā 

Here an example of one of my config files:

Ā 

//!/usr/lib/btsync/btsync-daemon --nodaemon --config//// This btsync instance provides sync services for// all common files in the YeaSoft Server Grid{	"device_name" : "yeasoft-gate2 - Server Sync",	"storage_path" : "/var/lib/btsync-serversync",	"listening_port" : 22144,	"check_for_updates" : false,	"use_upnp" : false,	"download_limit" : 0,	"upload_limit" : 0,	"lan_encrypt_data": true,	"lan_use_tcp" : true,	"rate_limit_local_peers" : false,	"webui" : {//		"listen" : "10.65.0.16:8889",//		"login" : "Administrator",//		"password" : "MyTestPassword"	}	,	"shared_folders" : [ {		"secret" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",		"dir" : "/mnt/data/tftproot/yeaboot",		"use_relay_server" : false,		"use_tracker" : false,		"use_dht" : false,		"search_lan" : true,		"use_sync_trash" : true,		"known_hosts" : [//			"10.65.0.16:22144",			"10.65.4.1:22144",			"10.65.6.1:22144",			"10.65.8.1:22144",			"10.65.16.1:22144",			"10.65.18.1:22144"		]	}	]}
As you can see, I made the same test: the web UI is disabled with comments... If you activate it, you have to comment out the shared folder section. In my special case, I disabled also all external helpers/relays and work only with predefined hosts.
Link to comment
Share on other sites

Yes. I have a very similar configuration on my server.

Ā 

Apparently I can't see anything wrong in your configuration file. But you must make sure, that the firewall of the server does not block the required connections. Since you have no chance to see anything, I would suggest to make a backup copy of your configuration file, remove completely the shared_folders section and activate the web UI in order to get a better overview of what is happening (you shared folder will still exist, since btsync has stored it into its internal database). After you solved your problem, you can deactivate the web UI and write the shared_folders section back.

Ā 

You hit the nail on the head. It was the firewall that caused me the problem. I had to open udp port 3000 to the outside world in order for the server to show up and start syncing.

Link to comment
Share on other sites

First, I've read this thread but I don't have a lot of experience doing admin stuff so I'm probably going to ask dumb questions and make dumb assumptions. I'm OK with that I just wanted to give fair warning. :)

Here is my situation: I've been using the user version of the desktop version of btsync (btsync-user) to synchronise three machines with the same set of files, and it's working pretty well so far. I appreciate how much easier it is to set up using apt and having access to the notification widget in my Kubuntu toolbar. [:)] I'd stayed away from the server stuff because it looked more complicated, but lately I've been thinking it might be useful if the machine that was running as my server for this (the one that generated all the secrets, essentially) was using it, since it *appears* that the server scripts run at a lower level, and I like the idea of being able to specify all those configuration options--especially the file priorities, and controlling how long the archives are kept.

The problem is that all the information I've seen in this thread *appears* to be focused on how to set up btsync from scratch. This makes sense, because usually you install the server before you configure clients, but my process was backwards: I was using the pure web btsync executable first, then moved to your user client because I wanted the web notification on my work machines, then thought "well, the server stuff would be nice to have." Is there a way to configure btsync on a machine that already has btsync-user and already has files that are being synchronised on it?

(Is this the wrong thread for a question like this? If so I apologize. It seemed relevant.)

Link to comment
Share on other sites

First, I've read this thread but I don't have a lot of experience doing admin stuff so I'm probably going to ask dumb questions and make dumb assumptions. I'm OK with that I just wanted to give fair warning. :)

You know? There are no stupid questions. There are only stupid answers ;)

Ā 

Here is my situation: I've been using the user version...

...

I'd stayed away from the server stuff because it looked more complicated, but lately I've been thinking it might be useful if the machine that was running as my server for this (the one that generated all the secrets, essentially) was using it, since it *appears* that the server scripts run at a lower level, and I like the idea of being able to specify all those configuration options--especially the file priorities, and controlling how long the archives are kept.

First of all let's clarify one thing: both packages install the same BitTorrent Sync executable. Because of that, there are absolutely no differences between what BitTorrent Sync is able to do. The difference stays in the way, your machine handles BitTorrent Sync:

  • If you install btsync-user (or the upcoming successor btsync-gui), you get an environment in which BitTorrent Sync is launched when you log in into your desktop as a process owned by you. When you logout, the process may be stopped (this is currently not happening with btsync-user, but it is a bug and may change in future...). This implies that the BitTorrent Sync process is able to read/write only files/directories on which YOU have write access. By default you work with a basic configuration file automatically created at each start. You can set advanced settings via the Web UI. There is also a possibility to use a custom configuration file in which you can specify everything you want. You can change settings in the Web UI, but at every restart these settings are overwritten by the settings you have specified into the configuration file.
  • If you install btsync (the server package) one or more BitTorrent Sync processes are started on system startup. They run independently from the users that may log in to the desktop. Obviously they work also on systems with no desktop installed. For each of those BitTorrent Sync processes there is a configuration file located in /etc/btsyncĀ and each of this processes can run under different user credentials (that are coded into comments in their respective configuration files). Additionally there is the possibility to specify the UMASK for the process, if you want BitTorrent Sync to create/write files with a different UMASK as the standard one.
Let's summarize: for you it makes sense to use btsync instead of btsync-user if:
  • You want BitTorrent Sync to run totally independently from any user logged into the system
  • You may want to have more than one instance running in future (this is the case, if you want to permanently synchronize the files of several users of the system).Ā 

The problem is that all the information I've seen in this thread *appears* to be focused on how to set up btsync from scratch. This makes sense, because usually you install the server before you configure clients, but my process was backwards: I was using the pure web btsync executable first, then moved to your user client because I wanted the web notification on my work machines, then thought "well, the server stuff would be nice to have." Is there a way to configure btsync on a machine that already has btsync-user and already has files that are being synchronised on it?

Yes. But first take a decision if the server package is really the right thing for you. If you say yes, I will explain here how you may migrate your system.

Ā 

(Is this the wrong thread for a question like this? If so I apologize. It seemed relevant.)

YesĀ  ;),Ā it IS relevant... and: NO, this is NOT the wrong thread.

Link to comment
Share on other sites

Good to know. :)

Ā 

As to whether or not the server package is the right thing for me, the main advantage of running it as a server is I don't have to log in to activate it, right? You could run it without having to deal with an xserver at all. I can certainly see the advantage of that--I installed the desktop version on an old laptop that I'm using as a makeshift file server and I do absolutely nothing else with it, so there's no reason to log into it unless something is wrong. For the other machines I use, the desktop version makes more sense...

Link to comment
Share on other sites

Finally the update...
Ā 

btsync-common (1.2.91-2) unstable; urgency=lowĀ Ā  * Added support for AMD Geode CPUĀ -- Leo Moll <leo.moll@yeasoft.com>Ā  Fri, 07 Mar 2014 16:27:01 +0100Ā btsync-common (1.2.91-1) unstable; urgency=lowĀ Ā  * New upstream releaseĀ  * Added support for btsync-gui when updatingĀ -- Leo Moll <leo.moll@yeasoft.com>Ā  Fri, 07 Mar 2014 13:37:33 +0100

Ā 
1.2.91-2Ā is available only on debian.yeasoft.netĀ since the Geode change is not relevant for Ubuntu (Ubuntu has no Kernel that runs on Geode machines).

As usual people using the Launchpad PPA have to wait a few hours (perhaps you may take in consideration moving from the PPA to debian.yeasoft.net).

One thing more: unfortunately Launchpad does not permit to update packages for outdated Ubuntu versions in the PPA. Because of this, there is no way to update the packages for Ubuntu Raring since the support has ceased. People using unsupported Ubuntu version must update to the debian.yeasoft.netĀ repository if they want to stay up to date.

Link to comment
Share on other sites

"Yes. But first take a decision if the server package is really the right thing for you. If you say yes, I will explain here how you may migrate your system."

Ā 

I have taken the same decision (to move to the server package), and am facing the same challenge. I had a version that I handled independently, but I much prefer the more formal approach you've taken with your packages.

Ā 

If you have a best method of moving the folders, secrets etc from the old installation to a new installation I would also find it immensely useful.

Ā 

Thanks

Ā 

Link to comment
Share on other sites

Tuxpoldo,

Ā 

Firstly, thanks very much for creating this package - it's a lot easier to run apt-get update than it was to do things manually!

Ā 

I have a feature request... I'm running btsync, among other things, on a raspberry pi and want btsync to have a lower priority... could you implement another configuration parameter NICE_VALUE ?

Ā 

Thanks!

Link to comment
Share on other sites

Tuxpoldo,

Ā 

Firstly, thanks very much for creating this package - it's a lot easier to run apt-get update than it was to do things manually!

Ā 

I have a feature request... I'm running btsync, among other things, on a raspberry pi and want btsync to have a lower priority... could you implement another configuration parameter NICE_VALUE ?

Thank you very much!

I've already planned to implement it in the next version of the server packages. Here the reference: Issue #96

Link to comment
Share on other sites

Thanks! I'm sure it will make many Raspberry Pi owners very happyĀ  :)

Ā 

Incidentally, a question for any other rpi users... I'm running btsync under 2 different user accounts, and when they're both idling, they're probably using around 10% CPU each... however my load average is consistently ~2.00 (not good!) with nothing else running.

Ā 

Has anyone else experienced this, and should I consider going back to only a single btsync instance? Ā (Is that likely to help, less context switching / etc?)

Link to comment
Share on other sites

Thanks! I'm sure it will make many Raspberry Pi owners very happyĀ  :)

Ā 

Incidentally, a question for any other rpi users... I'm running btsync under 2 different user accounts, and when they're both idling, they're probably using around 10% CPU each... however my load average is consistently ~2.00 (not good!) with nothing else running.

Ā 

Has anyone else experienced this, and should I consider going back to only a single btsync instance? Ā (Is that likely to help, less context switching / etc?)

Ā 

Please post here the two configuration files WITH BLANKED OUT SECRETS AND PASSWORDS. I have a suspicion, but I need to see the configuration files to verify that...

And here the low awaited new version....

Ā 

btsync (1.2.3-1) unstable; urgency=low  * Cleanup startup and shutdown messages  * Refreshed all debconf template translations  * Added Polish translation to debconf templates contributed    by Damian (xearonet)  * Added full support (including debconf) for specifying niceness    in the config file (Closes #96) -- Leo Moll <leo.moll@yeasoft.com>  Thu, 13 Mar 2014 21:54:42 +0100
Enjoy!
Link to comment
Share on other sites

Thanks for this. Just wondering how do I upgrade ?

Web GUI shows " version 1.2.82 ( up to date )"

Installed with the below a few months back.

sudo add-apt-repository ppa:tuxpoldo/btsync sudo apt-get update

sudo apt-get install btsync

Thanks for any help.

Rich

Sent from my Nexus 4 using Tapatalk

Link to comment
Share on other sites

Thanks for this. Just wondering how do I upgrade ?

Web GUI shows " version 1.2.82 ( up to date )"

Installed with the below a few months back.

sudo add-apt-repository ppa:tuxpoldo/btsync sudo apt-get update

sudo apt-get install btsync

Thanks for any help.

Rich

Sent from my Nexus 4 using Tapatalk

Ā 

I suppose you are using a version of Ubuntu that is not supported any more like Ubuntu 12.10 (Quantal), Ubuntu 13.04 (Raring). It is not possible any more to publish updates on Launchpad for those versions.

Ā 

You can switch to the debian.yeasoft.net repository (following the instructions in the initial posting). There I will continue to publish also for Ubuntu versions out of support.

Ā 

Anyway I would strongly suggest that you update your server to a supported version of Ubuntu.

Ā 

p.s.: Obviously you have to do:

sudo apt-get updatesudo apt-get upgrade

If you do not, you will get no upgrade....

Edited by tuxpoldo
Link to comment
Share on other sites

Ā 

Please post here the two configuration files WITH BLANKED OUT SECRETS AND PASSWORDS. I have a suspicion, but I need to see the configuration files to verify that...

Ā 

Ā 

Here they are (I use the web gui, so have just removed the user auth bits - obviously they both have different listen ports/usernames/passwords)...

Ā 

/etc/btsync/cam.conf:

//!/usr/lib/btsync/btsync-daemon --config//// DAEMON_UID=cam// DAEMON_NICE=18//{	"device_name": "RPi-Server (CAM)",	"listening_port" : 36574,	"storage_path" : "/home/cam/.BTSync",	"pid_file" : "/home/cam/.BTSync/btsync.pid",	"check_for_updates" : false,	"use_upnp" : true,	"download_limit" : 0,	"upload_limit" : 0, 	"webui" :	{		"listen" : "0.0.0.0:[PORT]",		"login" : "[USERNAME]",		"password" : "[PASSWORD]"	}}

and /etc/btsync/root.conf:

//!/usr/lib/btsync/btsync-daemon --config//// DAEMON_UID=root// DAEMON_NICE=18//{	"device_name": "RPi-Server",	"listening_port" : 36573,	"storage_path" : "/root/.BTSync",	"pid_file" : "/root/.BTSync/btsync.pid",	"check_for_updates" : false,	"use_upnp" : true,	"download_limit" : 0,	"upload_limit" : 0, 	"webui" :	{		"listen" : "0.0.0.0:[PORT]",		"login" : "[USERNAME]",		"password" : "[PASSWORD]"	}}

p.s. Thanks for the new version with niceness :-)

Link to comment
Share on other sites

Hi nburles,

Ā 

your config files seem ok to me. There are absolutely no conflicts between them. In any case I notices that btsync raises the system load. But there are a few tests that you can make.

Ā 

1. Try to stop one of the two services and look if you see a heavy change in system load (you can selectively start and stop service with "service btsync stop cam" or "service btsync start cam"

Ā 

2. Try to disable "use_upnp" on one or both services. I'm not sure but I remember to have read something about problems deriving from this...

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.