Introduction to BitTorrent Sync and its setup

Default featured post

If you have multiple devices such as laptop(s), PCs, smartphones and you want to keep your data sync without being in cloud or even without using internet, I highly recommend BitTorrent Sync.

In fact BitTorrent Sync allows you to sync multiple devices easily and is also available on various platforms which among them most importantly for me is Linux.

For syncing data I use two approaches one is Dropbox and other one is BitTorrent Sync.

Basically, I use Dropbox when I want to sync the files across all of my devices like my phone and tablet and also when I want to keep the file in Dropbox and sometimes as buffer or temporary channel when I am lazy to connect my phone or tablet to PC.

However, usage of BitTorrent Sync is totally different for me. I use BitTorrent Sync to sync various large files between my laptops with using LAN and nothing else. In fact, I don’t want to use internet as bridge or chancel and also no need to save my data in any cloud, if I want to keep in cloud I use Dropbox, Google Drive or Windows Live service.

If you need more introduction about BitTorrent Sync I recommend you to watch the below video.

Now let’s take a look at my BitTorrent Sync setup.

I have two laptops one is running on Ubuntu 12.04 and the other one sadly on Windows 8.1.

BitTorrent Sync  installed in both. In Windows platform you almost do not need to do anything complicated except allowing program to run on Windows startup and allowing to bypass firewall that is all.

In Ubuntu, there is no native GUI and it is web interface which is accessible from http://localhost:8888 address. However, in Ubuntu BitTorrent Sync won’t run on startup so you need to add one script to do so. The following steps does this job for you.

$ sudo vi /etc/init.d/btsync
$ sudo vi /etc/init.d/btsync

Then add the following script,

#! /bin/sh
# /etc/init.d/btsync
#
# Carry out specific functions when asked to by the system
case "$1" in
start)
/USERACCOUNT/.btsync/btsync –config /USERACCOUNT/.btsync/btsync.conf
;;
stop)
killall btsync
;;
*)
echo "Usage: /etc/init.d/btsync {start|stop}"
exit 1
;;
esac
exit 0
view raw test.sh hosted with ❤ by GitHub

And lastly,

$ sudo chmod 755 /etc/init.d/btsync
$ sudo update-rc.d btsync defaults

For stop and start service,

$ service btsync stop
$ service btsync start

Source of the script is from here.

In my case I wanted syncing be done through LAN cable which means two computers connected with LAN cable together and formed a P2P LAN network. Meanwhile I wanted to have internet wireless access in both computers. I actually didn’t change anything on the wireless network cards configuration, I just configure Ethernet cards according to my condition.

My wireless router IP address range is started from 192.168.X.X and therefore subnet mask would be 255.255.255.0 and default gateway 192.168.X.X.

Hence, in order to avoid conflicts and make things easier I decided to configure my Ethernet cards on totally different IP range. The IP range I selected is 10.42.0.X with  255.0.0.0 and default gateway 0.0.0.0. The Ethernet cards configuration theoretically refers to totally different network and therefore, I can access to the internet on both laptops using wireless and pass BitTorrent Sync traffic thru LAN cable and the outcome would be the following picture 😀

My Desk
My Desk

Finally, the last step I had to do was auto-mounting my NTFS partition on Ubuntu since some syncing files located there and that is done by using this link.