`

CentOS 安装BitTorrent Sync详细步骤

阅读更多

官网:http://labs.bittorrent.com/experiments/sync.html

这个软件安装完后通过网页浏览器设置共享目录并生成同步Secret,异地的客户端可以通过这个同步Secret访问共的目录,其中有读写和只读两种同步方式选择,以点对点的形式传送数据,其实可以理解为一种新型的P2P分享方式。

这里我们可以用这个软件来同步备份下载盒子上的指定目录的所有文件,下面的内容是盒子端的配置过程。

linux系统下的安装与配置(使用root用户登录)

1.首先要下载应用程序解压,根据系统的字长选择

32位系统

wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_i386.tar.gz
tar zxvf btsync_i386.tar.gz -C /root

64位系统

wget http://btsync.s3-website-us-east-1.amazonaws.com/btsync_x64.tar.gz
tar zxvf btsync_x64.tar.gz -C /root

2.运行程序输出配置模板文件

./btsync --dump-sample-config > btsync.conf

3.编辑上一步输出的btsync.conf

vi btsync.conf

将下面的<>部分改为你自己的服务器的信息。例如“<设备名>”改为“My BT Server”.
端口不要设置成80、8112、9091、443之类的,避免与其他软件应用冲突。

{ 
  "device_name": "<设备名>",
  "listening_port" : 0,                       // 0 - randomize port
  
/* storage_path dir contains auxilliary app files
   if no storage_path field: .sync dir created in the directory 
   where binary is located.
   otherwise user-defined directory will be used 
*/
  "storage_path" : "/home/root/.sync",

// uncomment next line if you want to set location of pid file
// "pid_file" : "/var/run/syncapp/syncapp.pid",


  "check_for_updates" : true, 
  "use_upnp" : true,                              // use UPnP for port mapping


/* limits in kB/s
   0 - no limit
*/
  "download_limit" : 0,                       
  "upload_limit" : 0, 

/* remove "listen" field to disable WebUI
   remove "login" and "password" fields to disable credentials check
*/
  "webui" :
  {
    "listen" : "<服务器的IP地址>:<端口>",
    "login" : "<登陆用户名>",
    "password" : "<登陆密码>"
  }

/* !!! if you set shared folders in config file WebUI will be DISABLED !!!
   shared directories specified in config file
   override the folders previously added from WebUI.
*/
/*
  ,
  "shared_folders" :
  [
    {
//  use --generate-secret in command line to create new secret
      "secret" : "MY_SECRET_1",                   // * required field
      "dir" : "/home/user/bittorrent/sync_test", // * required field

//  use relay server when direct connection fails
      "use_relay_server" : true,
      "use_tracker" : true, 
      "use_dht" : false,
      "search_lan" : true,
//  enable sync trash to store files deleted on remote devices
      "use_sync_trash" : true,
//  specify hosts to attempt connection without additional search     
      "known_hosts" :
      [
        "192.168.1.2:44444",
        "myhost.com:6881"
      ]
    }
  ]
*/

// Advanced preferences can be added to config file.
// Info is available in BitTorrent Sync User Guide.

}

4.运行BT sync,此时系统会新增一个btsync进程

./btsync --config btsync.conf

如果想关闭BT sync可以使用killall命令关闭

killall btsync

5.把BT sync加入开机启动

vi /etc/rc.local

exit 0 前一行加入

cd /root
./btsync --config btsync.conf

通过本地浏览器打开<服务器的IP地址>:<端口>/gui 登陆以后即可设置同步目录。
目前客户端只有英文版的界面,但是设置使用起来比较简单。做图文教程很累的,所以不打算制作如何使用的图文教程了,况且界面真的很简单,如果还有问题可以在本贴回复提问。
windows客户端: 点击下载
Mac客户端: 点击下载
进入官网还有其他包括ARM平台的客户端可以下载。
使用注意事项:
1.如果是选择只读同步(服务器->本地),在文件传送完毕后如果不想再同步,记得在本地客户端上删除同步的目录,否则容易出现服务器端删除了文件,本地也会自动的删除该文件的情况。当然,读写同步更是如此。

原文来自零度科技:http://www.ldisp.com/a/linux/2013/CentOS-BitTorrent-Sync.shtml

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics