知点IT

跨平台同步神器Syncthing

space 51 0

特别声明:文章多为网络转载,资源使用一般不提供任何帮助,特殊资源除外,如有侵权请联系!

Syncthing 是一款开源的文件同步工具,它允许用户在多个设备之间同步文件,而无需上传到第三方服务器,从而确保了数据的安全性和隐私性。

软件准备

本次实验需要在Windows平台实验,所以需要准备Syncthing、nssm两个软件。

Syncthing: syncthing-windows-amd64-v2.0.10

nssm: nssm-2.24

开源地址

类型地址速度建议
主库https://github.com/syncthing/syncthing拉取最新代码
Giteehttps://gitee.com/mirrors/syncthing/推荐使用
Gitcodehttps://gitcode.com/GitHub_Trending/sy/syncthing推荐使用
知点镜像https://git.worsoon.com/mirrors/syncthing上面所有仓库都不可用时

软件配置

synthing是主同步软件,为了方便使用,首先查看下他的基本控制语法文件:

syncthing [serve]
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--allow-newer-config] [--audit] [--auditfile=<file|-|-->]
          [--db-maintenance-interval=<interval>]
          [--db-delete-retention-interval=<interval>]
          [--gui-address=<address>] [--gui-apikey=<key>]
          [--log-level=<level>] [--log-file=<filename>]
          [--log-max-old-files=<num>] [--log-max-size=<num>]
          [--log-format-timestamp=<format>] [--no-log-format-level-string]
          [--log-format-level-syslog]
          [--no-browser] [--no-console]
          [--no-port-probing] [--no-restart] [--no-upgrade]
          [--paused] [--unpaused]
          [--version] [--help] [--debug-*]

syncthing cli
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--gui-address=<address>] [--gui-apikey=<key>]
          [--help]
          <command> [command options...] [arguments...]

syncthing browser
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--help]

syncthing decrypt (--to=<dir> | --verify-only)
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--password=<pw>] [--folder-id=<id>] [--token-path=<file>]
          [--continue] [--verbose] [--help]
          <path>

syncthing device-id
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--help]

syncthing generate
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--gui-user=<username>] [--gui-password=<password|->]
          [--no-port-probing]
          [--help]

syncthing paths
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--help]

syncthing upgrade
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--check-only] [--from=<url>]
          [--help]

syncthing version
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--help]

syncthing debug <command>
          [--home=<dir> | --config=<dir> --data=<dir>]
          [--help]

从上面指令可以看出,我们如果需要控制syncthing不显示控制台,不显示浏览器可以使用:--no-console--no-browser两个选项。所以基本语法为:

%PATH_OF_SYNCTHING%/syncthing.exe --no-browser --no-console --no-upgrade

NSSM整合

为了方便将Syncthing注册为后台,实现自动检索与同步,我们通常会将synthing设置为后台服务运行,这里需要借助nssm软件。

见准备好的nssm软件解压到指定目录中,然后使用控制台启动输入下面指令:

nssm install syncthing

然后软件会自动要求管理员权限,按照下面图片指示,输入参数即可。

然后点击安装。

自动启动

进入Windows服务管理中心,然后找到Syncthing,双击打开。

评论列表 (已有0条评论)

消灭零回复

发表评论 (已有0条评论)