1

首先前往BitTorrent Sync官网下载程序包, 解压程序包.之后创建目录存放BitTorrent Sync, 并赋予其相应权限:

mkdir /etc/btsync
mv btsync /etc/btsync/
cd /etc/btsync/
chown root:root btsync
chmod 755 btsync

从BitTorrent Sync创建出一个默认配置模板文件:

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

修改配置模板文件:

  • "device_name" --> 随便你想为这个设备取什么名
  • "storage_path" --> 注释掉这一行,并为其创建相应目录存放配置
  • "login" --> 随便你想取什么登陆名
  • "password" --> 为你的登录名创建一个密码

之后在/etc/init.d/创建一个脚本程序用于开始, 停止BitTorrent Sync:

touch /etc/init.d/btsync
emacs /etc/init.d/btsync
#! /bin/sh
# /etc/init.d/btsync
#

# Start or Stop BT Sync
case "$1" in
  start)
        /etc/btsync/./btsync --config /etc/btsync/sync.conf
    ;;
  stop)
        pkill btsync
    ;;
  *)
    echo "Usage: /etc/init.d/btsync {start|stop}"
    exit 1
    ;;
esac

exit 0

赋予脚本执行权限:

chmod +x /etc/init.d/btsync

将脚本载入开机启动程序序列:

update-rc.d btsync defaults

使用这条命令启动BitTorrent Sync:

/etc/init.d/btsync start

之后打开http://you-r-ip:8888即可打开BitTorrent Sync的网页配置了.


venmos
462 声望15 粉丝

Maccon, Emacscon, Lolicon, ACG. False geek, Looks like a quiet guy. Love open source, Loves photography and outdoor sports. Favorite programming language is Ruby and Lisp.