BitTorrent Sync or BT Sync uses BitTorrent technology to facilitate peer to peer file synchronization. It allows almost true peer to peer setup without a central server (except for a tracker). Clients can come on and offline as an when and so long as there is 1 up to date service containing the files then it will transfer them across when needed.
I’ve tested this on a Ubuntu 14.04 server edition:
Add a PPA to the repository list:
sudo add-apt-repository ppa:tuxpoldo/btsync -y
Fetch updates now that there’s a new repository added:
sudo apt-get update
Install BT Sync:
sudo apt-get install btsync
During the install it will ask if you want to setup BT Sync from the command line. You can always reconfig it again by running:
sudo dpkg-reconfigure btsync
The initial setup wizard will be a cut down version of the dpkg-reconfigure so below should cover the extended version:
Select Yes to Do you want to define a default BitTorrent Sync instance?. BT Sync allows multiple instances of BT Sync to run for example if you want to setup a per user config for example but it’s beyond the scope of this post.
Select btsync for BitTorrent Sync Daemon Credentials:. This will mean btsync user will need access to the directory it will be syncing. An alternative to btsync account would be the user who owns the directory if the system only has one real user.
Select default for BitTorrent Sync Daemon Group:
Set Niceness of the BitTorrent Sync Daemon: to 0. This affects how much computer resources it uses. 0 is let BT Sync decide.
The visible device name of this instance can be set to any friendly name to name the “device”.
BitTorrent Sync Listen Port is the port it will use to sync on. This means it will require this port to be opened on the router if necessary.
External port number reported to the tracker is the port number used to talk to the tracker. I left this as 0
Set No for UPNP (I’ve never been a fan but if you’re lazy then set this to Yes so you don’t have to configure the router’s port settings).
I left the download speed limit to unlimited (0).
I left the upload speed limit to unlimited (0).
Leave the Web Interface Bind IP Address to be 0.0.0.0.
Set the Web Interface Listen Port to either 80 (default web port as long as there are no other service running on the same port) or some other desire port. In this case I left it as 8888. This port is to allow web management of BT Sync settings.
Set the username for the admin web management page.
Set the password for the admin account.
Leave the BitTorrent Sync API Key empty.
Set 002 for the Umask value. 002 will give the owner and group full access to files and only read and execute to other users. Change this according to your needs.
Select Yes for Should BitTorrent Sync perform disk operations with low priority? This will de-prioritise disk writes from BT Sync so if there are a lot of files to sync it should have less impact on the system.
Answer Yes to Should BitTorrent Sync encrypt data on the local network.
Select Yes to Should BitTorrent Sync use TCP on the local network. TCP should be more reliable form of connection because it will receive acknowledgements to sent data.
If you want to limit the speed for local peers then select Yes to Should BitTorrent Sync Apply speed limits also in local network. I select No.
Fall back folder rescan interval in seconds. I cut this number down from 600 (10 minutes) to 150 (2 min, 30 secs).
Leave the following options empty to let BT Sync use the default:
Leave the Debug logfile size in MB to 10.
After all that you can go to your bowser and setup the folders through the web at http://myServer:8888 replacing myServer with the server address.
I’ve found BT Sync to work really well and fast but the documentation is very bad especially for running it on the server. Bear in mind this is still in beta at the time of writing so make sure you have backup of the data.
How To Use BitTorrent Sync to Synchronize Directories in Ubuntu 12.04