树莓派 文件同步工具Syncthing 安装部署
安装Syncthing官网源
在/etc/apt/sources.list.d
创建文件syncthing.list
,内容如下deb https://apt.syncthing.net syncthing stable
然后执行apt-get update
安装Syncthingapt-get install syncthing
执行syncthing
,程序会自动创建配置文件
修改配置文件/root/.config/syncthing/config.xml
将<address>127.0.0.1:8384</address>
修改为<address>0.0.0.0:8384</address>
否则只能本地访问WebUI
创建服务脚本/etc/init.d/syncthing
,权限755,内容如下
#!/bin/sh
case "$1" in
start)
echo "Starting Syncthing"
nohup /usr/bin/syncthing > /dev/null 2>&1 &
;;
stop)
echo "Shutting Syncthing"
killall -9 syncthing
;;
restart)
echo "Restarting Syncthing"
killall -9 Syncthing
nohup /usr/bin/syncthing > /dev/null 2>&1 &
;;
esac
exit
启动、停止、重启
/etc/init.d/syncthing start | stop | restart