How to Use btsync to share files between computers through the network

Source: Internet
Author: User
Tags btsync

How to Use btsync to share files between computers through the network

If you are the kind of person who uses various devices to work online, I believe that you need a method to synchronize files and directories between different devices. At least you are eager to have this function.

BitTorrent Sync (btsync) is a free cross-platform synchronization Tool Based on BitTorrent (the famous P2P file sharing protocol. Unlike the traditional BitTorrent client, btsync can encrypt data transmission between different operating systems and devices and grant shared file access permissions based on automatically generated keys.

More specifically, when you want to share some files or folders through btsync, the corresponding read/write key (so-called password) is created. These keys can be shared among different devices through HTTPS links, e-mails, and QR codes. Once the two devices are successfully paired with one key, the corresponding content will be synchronized directly. If you do not set it in advance, there will be no file size and speed restrictions for transmission. You can create an account in btsync so that you can create and manage keys and files shared over the network through the web interface.

BitTorrent Sync can run on many operating systems, including Linux, MacOS X, and Windows. It can also be used on Android and iOS. Here, we will teach you how to use BitTorrent Sync to synchronize files between a Linux environment (a home server) and a Windows environment (a laptop.

 

Install btsync in Linux

BitTorrent Sync can be directly downloaded on the project homepage. Because the Windows version of BitTorrent Syn is very simple to install, we assume that the notebook has been installed. We focus on the installation and configuration of Linux servers.

On the download page, select your system architecture, right-click the corresponding link, copy the connection address (or similar functions, different browsers may be different), and paste the link to the terminal for wget download, as follows:

64-bit Linux:

  1. # wget http://download.getsyncapp.com/endpoint/btsync/os/linux-x64/track/stable

32-bit Linux:

  1. # wget http://download.getsyncapp.com/endpoint/btsync/os/linux-i386/track/stable

After downloading the package, decompress the package content to the directory you have created. To do this:

  1. # cd /usr/local/bin
  2. # mkdir btsync
  3. # tar xzf stable -C btsync

Now you can add/usr/local/bin/btsync to the environment variable PATH.

  1. export PATH=$PATH:/usr/local/bin/btsync

Or run the binary file of btsync in this folder. We recommend the first method, which requires a small amount of input but is easier to remember.

 

Configure btsync

Btsync has a built-in network server used as its management interface. To use this interface, you need to create a configuration file. You can use the following command to create an instance:

  1. # btsync --dump-sample-config > btsync.config

Then use your most commonly used editor to make the following changes to the btsync. config file (webui part ):

  1. "listen":"0.0.0.0:8888",
  2. "login":"yourusername",
  3. "password":"yourpassword"

You can select any user name and password.

If you want to optimize its configuration in the future, you can check the README file in the/usr/local/bin/btsync directory, but now let's continue with the following steps.

 

First Run btsync

As the highest performer of a system, we need to rely on log files! So before we start btsync, we will first create a log file for btsync.

  1. # touch /var/log/btsync.log

Finally, let's start btsync:

  1. # btsync --config /usr/local/bin/btsync/btsync.config --log /var/log/btsync.log

Enter the Server IP address and port (192.168.0.15: 8888) that the running btsync listens to in your browser and agree to its privacy policy, terms and End User License Agreement:

In this way, the page will go to the btsync homepage you have installed:

Click Add folder and select a directory to be shared in your file system. In our example, we use/btsync:

This is enough now. Before running the following steps, install BitTorrent Sync on a Windows host (or another Linux device you want to use.

 

Btsync file sharing

This video shows how to share an existing folder on the computer [192.168.0.106] with Windows 8 installed. After adding the folder to be synchronized, you will get its key through the "Enter a key or link" menu (the figure above has already been shown) add it to the Linux machine you installed and start synchronization.

Try it on another device. Find a folder or some files you want to share and import the key to the central btsync installed by using the network interface of the Linux server.

 

Automatically run btsync when a regular user is started

You may have noticed that when Synchronizing files in the video, users in The 'root' group are used to create/btsync directories. That's because we use superusers to manually start BitTorrent Sync. Generally, you want it to start automatically with an unauthorized user (www_data or an account specially created for this purpose, such as btsync.

Therefore, we created a user named btsync and added the following fields in the/etc/rc. local file (before exit 0:

  1. sudo -u btsync /usr/local/bin/btsync/btsync --config /usr/local/bin/btsync/btsync.config --log /var/log/btsync.log

Finally, create the pid file:

  1. # touch /usr/local/bin/btsync/.sync/sync.pid

And recursively change the user of/usr/local/bin/btsync:

  1. # chown -R btsync:root /usr/local/bin/btsync

Restart now and try to see if btsync is running by the expected User:

Depending on the version you selected, you may find different ways to start btsync at startup. In this tutorial, the rc. local method is selected because it can be used in different releases.

 

Tail note

As you can see, BitTorrent Sync is almost like a serverless Dropbox for you. The reason I say "almost" is that when you synchronize data in the LAN, the synchronization is directly performed between two devices. However, if you want to synchronize data across network segments and your device may need to pair through the firewall restrictions, you can only use a third-party relay server that provides BitTorrent for synchronous transmission. Although it is claimed that the transmission is encrypted by AES, you may encounter a situation that you do not want to happen. For your privacy, you must turn off the relay/Trace option in each folder you share.

Hope these will be useful to you! Happy sharing!

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.