GithubHelp home page GithubHelp logo

实际使用方法 about gofs HOT 1 CLOSED

llichee avatar llichee commented on July 23, 2024
实际使用方法

from gofs.

Comments (1)

mstmdev avatar mstmdev commented on July 23, 2024

嗯,文档还是有点生硬,有待改进。

如果想要实现Linux到Windows的文件同步,不同场景有不同的方式,这是其中的一种方式,使用远程磁盘服务端远程磁盘客户端来实现。

首先需要在Linux上启动一个gofs服务端进程,然后在你的Windows上部署一个gofs客户端进程来接收数据或者定时去拉取数据。

下面是一个简单的示例:
服务端(Linux)

# 其中192.168.1.2是你linux服务器的IP
# ./source是你linux服务器上需要被同步的路径地址
# ./dest 这个是服务器上本地同步的目标路径,任意创建一个目录配置上就行,这里暂时用不到
# gofs|password|rwx 代表的是用户名|密码|权限,自行指定复杂并安全的用户名和密码,权限这里可以暂时不用管,保持rwx,目前的最大权限
# -tls_cert_file=cert.pem -tls_key_file=key.pem 这个是TLS相关证书文件的全路径,如果没有的话,通过命令创建一个测试的证书,参见【先决条件】小节
# 当然你也可以通过指定-tls=false来禁用TLS传输,并且将下面配置的https://192.168.1.2改为http://192.168.1.2,这样也可以但不建议

$ gofs -source="rs://0.0.0.0:8105?mode=server&local_sync_disabled=true&path=./source&fs_server=https://192.168.1.2" -dest=./dest -users="gofs|password|rwx" -tls_cert_file=cert.pem -tls_key_file=key.pem

客户端(Windows)

# 192.168.1.2替换为上面配置的linux服务器的IP
# ./dest 替换为你需要同步的目标路径,确保路径已存在,所有同步的文件都会在这个目录下
# gofs|password 是你在服务端配置的账号密码,自行修改即可,不需要指定第三个权限字段

$ gofs -source="rs://192.168.1.2:8105" -dest=./dest -users="gofs|password"

另外,如果你的客户端(Windows)无法直接通过IP访问服务端(Linux),那么需要使用中继模式来实现,需要单独再配置一个中继服务,然后将上面的服务器IP地址修改为中继服务器暴露出来的地址,详见【中继】一节。

from gofs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.