Rclone挂载Webdav作为本地磁盘
本文大部门内容来自Rclone官网挂载部门手册
参考
https://www.bilibili.com/read/cv21803909/
https://www.bilibili.com/read/cv26300078/
https://www.bilibili.com/read/cv35177013/
https://www.bilibili.com/read/cv13661426/
本文旨在用Rclone代替Raidrive与CloudDrive,在Windows情况下挂载Webdav为本地硬盘的使用场景
1 Rclone下载
下载Rclone需要前往github
下载
点击最右侧的Releases进入发行版页面,Windows用户下载带有Windows-amd64的即可
1.1 WinFSP下载
Windows用户需要再安装WinFSP作为支持,同为github
下载
与上同理,WinFSP需要下载msi后缀文件
2 安装
Rclone在Windows情况下为压缩包,在某一文件夹解压
WinFSP直接安装即可
3 Rclone导入服务器
在rclone.exe应用程序地点文件夹右键,选择在终端中打开
输入
进入服务器的设置界面
- Current remotes:
- Name Type
- ==== ====
- webdav webdav
- e) Edit existing remote #修改服务器设置
- n) New remote #新设置
- d) Delete remote #删除设置
- r) Rename remote #重命名设置
- c) Copy remote #复制设置
- s) Set configuration password #设置配置设置密码
- q) Quit config #退出设置
- e/n/d/r/c/s/q>
复制代码 全设置参考
- Current remotes:
- Name Type
- ==== ====
- webdav webdav
- e) Edit existing remote
- n) New remote
- d) Delete remote
- r) Rename remote
- c) Copy remote
- s) Set configuration password
- q) Quit config
- e/n/d/r/c/s/q> n
- # 输入n 选择新创建设置
- Enter name for new remote.
- name> webdav
- # 输入新设置的名称
- Option Storage.
- Type of storage to configure.
- Choose a number from below, or type in your own value.
- 1 / 1Fichier
- \ (fichier)
- 2 / Akamai NetStorage
- \ (netstorage)
- 3 / Alias for an existing remote
- \ (alias)
- 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Magalu, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
- \ (s3)
- 5 / Backblaze B2
- \ (b2)
- 6 / Better checksums for other remotes
- \ (hasher)
- 7 / Box
- \ (box)
- 8 / Cache a remote
- \ (cache)
- 9 / Citrix Sharefile
- \ (sharefile)
- 10 / Combine several remotes into one
- \ (combine)
- 11 / Compress a remote
- \ (compress)
- 12 / Dropbox
- \ (dropbox)
- 13 / Encrypt/Decrypt a remote
- \ (crypt)
- 14 / Enterprise File Fabric
- \ (filefabric)
- 15 / FTP
- \ (ftp)
- 16 / Google Cloud Storage (this is not Google Drive)
- \ (google cloud storage)
- 17 / Google Drive
- \ (drive)
- 18 / Google Photos
- \ (google photos)
- 19 / HTTP
- \ (http)
- 20 / Hadoop distributed file system
- \ (hdfs)
- 21 / HiDrive
- \ (hidrive)
- 22 / ImageKit.io
- \ (imagekit)
- 23 / In memory object storage system.
- \ (memory)
- 24 / Internet Archive
- \ (internetarchive)
- 25 / Jottacloud
- \ (jottacloud)
- 26 / Koofr, Digi Storage and other Koofr-compatible storage providers
- \ (koofr)
- 27 / Linkbox
- \ (linkbox)
- 28 / Local Disk
- \ (local)
- 29 / Mail.ru Cloud
- \ (mailru)
- 30 / Mega
- \ (mega)
- 31 / Microsoft Azure Blob Storage
- \ (azureblob)
- 32 / Microsoft Azure Files
- \ (azurefiles)
- 33 / Microsoft OneDrive
- \ (onedrive)
- 34 / OpenDrive
- \ (opendrive)
- 35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
- \ (swift)
- 36 / Oracle Cloud Infrastructure Object Storage
- \ (oracleobjectstorage)
- 37 / Pcloud
- \ (pcloud)
- 38 / PikPak
- \ (pikpak)
- 39 / Proton Drive
- \ (protondrive)
- 40 / Put.io
- \ (putio)
- 41 / QingCloud Object Storage
- \ (qingstor)
- 42 / Quatrix by Maytech
- \ (quatrix)
- 43 / SMB / CIFS
- \ (smb)
- 44 / SSH/SFTP
- \ (sftp)
- 45 / Sia Decentralized Cloud
- \ (sia)
- 46 / Storj Decentralized Cloud Storage
- \ (storj)
- 47 / Sugarsync
- \ (sugarsync)
- 48 / Transparently chunk/split large files
- \ (chunker)
- 49 / Uloz.to
- \ (ulozto)
- 50 / Union merges the contents of several upstream fs
- \ (union)
- 51 / Uptobox
- \ (uptobox)
- 52 / WebDAV
- \ (webdav)
- 53 / Yandex Disk
- \ (yandex)
- 54 / Zoho
- \ (zoho)
- 55 / premiumize.me
- \ (premiumizeme)
- 56 / seafile
- \ (seafile)
- Storage> 52
- # 选择webdav对应的编号 我这边为52 需要根据你实际编号选择
- Option url.
- URL of http host to connect to.
- E.g. https://example.com.
- Enter a value.
- url> http://192.168.1.1:8800
- # 输入你Webdav服务器对应的链接与端口
- Option vendor.
- Name of the WebDAV site/service/software you are using.
- Choose a number from below, or type in your own value.
- Press Enter to leave empty.
- 1 / Fastmail Files
- \ (fastmail)
- 2 / Nextcloud
- \ (nextcloud)
- 3 / Owncloud
- \ (owncloud)
- 4 / Sharepoint Online, authenticated by Microsoft account
- \ (sharepoint)
- 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
- \ (sharepoint-ntlm)
- 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
- \ (rclone)
- 7 / Other site/service or software
- \ (other)
- vendor> 7
- # Rclone提供了几种常用的Webdav设置 我为自己搭建 选择7(other)
- Option user.
- User name.
- In case NTLM authentication is used, the username should be in the format 'Domain\User'.
- Enter a value. Press Enter to leave empty.
- user> DAV_user
- # 输入Webdav用户名
- Option pass.
- Password.
- Choose an alternative below. Press Enter for the default (n).
- y) Yes, type in my own password
- g) Generate random password
- n) No, leave this optional password blank (default)
- y/g/n> y
- # 需要密码 选择y
- Enter the password:
- password:
- Confirm the password:
- password:
- # 输入密码时不会显示密码
- Option bearer_token.
- Bearer token instead of user/pass (e.g. a Macaroon).
- Enter a value. Press Enter to leave empty.
- bearer_token>
- # 没有设置令牌按回车留空
- Edit advanced config?
- y) Yes
- n) No (default)
- y/n> n
- # 开启高级设置 这边并不需要 选择n
- #确认你的设置是否有错误
- Configuration complete.
- Options:
- - type: webdav
- - url: http://192.168.1.30:8800
- - vendor: other
- - user: DAV_user
- - pass: *** ENCRYPTED ***
- Keep this "webdav" remote?
- y) Yes this is OK (default)
- e) Edit this remote
- d) Delete this remote
- y/e/d> y
- # 确认无误
- Current remotes:
- Name Type
- ==== ====
- webdav webdav
- e) Edit existing remote
- n) New remote
- d) Delete remote
- r) Rename remote
- c) Copy remote
- s) Set configuration password
- q) Quit config
- e/n/d/r/c/s/q>q
- # 可以看到自己的设置了 退出
复制代码 4 Rclone挂载
设置完服务器后,便可以使用Rclone举行挂载了
在Rclone地点文件夹打开下令行,输入
- .\rclone.exe mount webdav:/ W: --vfs-cache-mode writes --cache-dir ./cache --log-level INFO --progress --file-perms 0777
复制代码 下面分开解释下令意义
- .\rclone.exe
- 指代当前文件夹下的rclone.exe文件
复制代码- webdav:/ W:
- webdav指的是你设置的名称 :/表示挂载的远程文件夹 W:指挂载在电脑上的盘符
复制代码- --vfs-cache-mode writes
- vfs虚拟文件系统 缓存模式 写入
- Rclone存在4种缓存模式:off|minimal|writes|full
- 缓存模式越高,rclone 的兼容性就越好,但会占用更多的磁盘空间
- 如果你的网速够快可以考虑选择off 关闭缓存
复制代码- --cache-dir ./cache
- 缓存目录 这里./cache指 在本文件夹下的cache文件夹中
复制代码- --log-level INFO --progress
- 让命令行输入INFO类型的日志 同时显示上传或下载的进度条
复制代码- --file-perms 0777
- 更改文件权限 设置为全部权限(UNIX格式)
- 默认的权限为0666,即不包含运行权限
- 如果你不需要在挂载中运行exe程序可以忽略该行
复制代码 5 设置Rclone开机启动
注意修改下文中所有下令的对应名称,并确认你是否需要以下功能
D:\Rclone\rclone.exe
rclone.exe文件地点的文件路径
webdav:/ W:
webdav:设置的名称 W:挂载的本职位置
–vfs-cache-mode writes
缓存方式,一般发起为writes
–file-perms 0777
文件权限设置 不需要运行exe文件可以忽略
5.1 有下令行窗口实现方法
但由于此方式仍有下令行常驻桌面,5.2有用vbs来实现隐蔽下令行的结果
此设置开机启动方式为设置bat文件
新建txt文本,放入以下内容
- D:\Rclone\rclone.exe mount webdav:/ W: --vfs-cache-mode off --file-perms 0777
复制代码 将txt文本后缀改为bat
将bat文件放入Windows的启动目录中C:\%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
5.2 隐蔽下令行窗口实现方法
此设置开机启动方式为设置bat文件,用vbs文件打开bat文件隐蔽下令行窗口
新建txt文本,放入以下内容
- D:\Rclone\rclone.exe mount webdav:/ W: --vfs-cache-mode off --file-perms 0777
复制代码 将txt文本后缀改为bat
新建txt文本,放入以下内容
- CreateObject("WScript.Shell").Run "cmd /c D:\Rclone/rclone.bat",0
复制代码 将txt文本后缀改为vbs
将vbs文件放入Windows的启动目录中C:\%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
6 Rclone额外常用下令
下面内容未颠末笔者测试,内容来自于官网手册
仅作部门翻译
假如需要rclone自己分配可用盘符
- .\rclone.exe mount webdav:/ *
- 将盘符改为" * "
- Rclone也可挂载到文件夹中,修改参数可实现
复制代码 挂载为网络驱动器
修改Windows文件夹访问权限
VFS目录缓存
- --dir-cache-time duration 缓存目录条目时间 (默认为 5m0s)
- --poll-interval duration 在轮询更改之间的等待时间 需要小于上面一条的时间 设置为0禁用 (默认为 1m0s)
复制代码 VFS文件缓冲
- --buffer-size
- 此标志是每个打开文件所用内存的上限。缓冲区将只使用内存来存储已下载但尚未读取的数据。如果缓冲区为空,则只会使用少量内存。
复制代码 VFS文件缓存
- --cache-dir string 缓存目录
- --vfs-cache-mode CacheMode Cache mode off|minimal|writes|full (默认 off)
- --vfs-cache-max-age duration 自上次访问缓存中的对象以来的最大时间 (默认 1h0m0s)
- --vfs-cache-max-size SizeSuffix 缓存中对象的最大总大小 (默认 off)
- --vfs-cache-min-free-space SizeSuffix 在包含缓存的磁盘上设定最小可用空间的目标 (默认 off)
- --vfs-cache-poll-interval duration 轮询缓存以查找过时对象的时间间隔 (默认 1m0s)
- --vfs-write-back duration 使用缓存时最后一次使用后写回文件的时间 (默认 5s)
复制代码 免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |