目前国内网盘相继关闭,BitTorrent作为一个替代者基本上可以满足我们的需求。选择一个运行Linux系统的NAS或者自己组装一台NAS,使用FreeBSD+ZFS(或者FreeNAS)作为24小时开机的同步源。其他PC上安装对应的版本通过KEY即可进行文件同步。
这里是使用FreeBSD作为主机的配置
在getsync.com获取最新的软件包
$ cd /home/jilili/Scripts
$ wget https://download-cdn.getsync.com/stable/FreeBSD-x64/BitTorrent-Sync_freebsd_x64.tar.gz
$ tar -zxvf BitTorrent-Sync_freebsd_x64.tar.gz
编辑启动脚本
# cd /usr/local/etc/rc.d
# touch btsync
# ee btsync
启动脚本
#!/bin/sh
#
# PROVIDE: btsync
# REQUIRE: LOGIN DAEMON NETWORKING
# KEYWORD: shutdown
#
# To enable BTSync, add this line to your /etc/rc.conf:
#
# btsync_enable="YES"
#
# And optionally these line:
btsync_user="jilili" # Default is "root"
btsync_bin="/home/jilili/Scripts/btsync" # Default is "/usr/local/sbin/btsync"
. /etc/rc.subr
name="btsync"
rcvar=btsync_enable
: ${btsync_enable="NO"}
: ${btsync_user="root"}
: ${btsync_bin="/usr/local/sbin/btsync"}
command=$btsync_bin
command_args="--webui.listen 0.0.0.0:8888"
start_cmd="${name}_start"
btsync_start() {
echo "btsync start."
su - ${btsync_user} -c "${command} ${command_args}"
su - ${btsync_user} -c "pwd"
if [ "$?" ]; then
echo "Start ... OK"
return 0
else
echo "Start ... FAILED"
return 1
fi
}
load_rc_config $name
run_rc_command "$1"
添加启动权限
# chmod ug+x /usr/local/etc/rc.d/btsync
调用启动脚本
# ee /etc/rc.conf
...
# BitTorrent Sync
btsync_enable="YES"
启动服务
/usr/local/etc/rc.d/btsync start
使用浏览器打开http://yourhost:8888,可进行操作。。。
