简介
什么是Rclone?
Rclone是一个命令行工具,用于管理和同步云存储服务中的文件和目录。它支持超过40种云存储服务,包括Amazon S3、Google Drive、Microsoft OneDrive、Dropbox等。Rclone提供了丰富的功能,包括文件复制、同步、加密、压缩、断点续传等。它可以在本地文件系统和云存储服务之间实现快速、安全、可靠的文件传输和同步操作。Rclone支持多种传输协议,如HTTP、WebDAV、FTP、SFTP等,并且可以通过Fuse安装将云存储挂载为本地文件系统。总之,Rclone是一个强大而灵活的工具,可帮助用户轻松管理和同步云存储服务中的文件和目录。
什么是 WebDAV?
WebDAV(Web Distributed Authoring and Versioning)是一种基于HTTP协议的扩展,允许用户通过Web浏览器或专用客户端访问和管理远程服务器上的文件和目录。它提供了一套标准的方法和扩展,用于上传、下载、删除、创建目录等文件操作,并支持高级功能如文件锁定和版本控制。WebDAV可以将云存储服务像章鱼的触角连接到各种应用程序,实现对云端存储内容的读写操作。它为用户提供了方便、安全和可靠的远程文件访问方式,广泛应用于协作、云存储和文件共享等场景。
有哪些支持WebDAV的网盘?
国外网盘:Box、Dropbox、Teracloud、yandex、TransIP
国内网盘:坚果云、城通网盘
私有云:OwnCloud、Seafile 、群晖
教程
1.准备支持WebDAV的网盘
本教程使用的是日本免费网盘Teracloud
链接:https://infini-cloud.net(注册送20G,输入邀请码QQDA3
再送5G)
注册登录进入我的页面:https://infini-cloud.net/en/modules/mypage/usage/勾选Turn on Apps Connection
保存三个参数URL、ID、Password (应用密码只会显示一次,注意保存)
2.安装Rclone
curl https://rclone.org/install.sh | sudo bash
[root@SEEK ~]# curl https://rclone.org/install.sh | sudo bash
......
...
rclone v1.62.2 has successfully installed.
Now run "rclone config" for setup. Check https://rclone.org/docs/ for more details.
//完成安装
初始化配置rclone config
[root@SEEK ~]# rclone config
2023/06/29 12:02:30 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found, make a new one?
n) New remote //新建一个远程存储
s) Set configuration password //设置配置文件的密码
q) Quit config //退出配置界面
键入n
新建配置
n/s/q> n
Enter name for new remote.
name>TeraCloud //配置名称
挂载webdav网盘,选择46
WebDAV
配置网盘
Option url.
URL of http host to connect to.
E.g. https://example.com.
Enter a value.
url>https://wani.teracloud.jp/dav/ //复制粘贴刚刚保存的URL
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 / Other site/service or software
\ (other)
vendor>5 //输入5选择其他网站/服务或软件
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> itluo // user输入保存的Connection ID
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: //复制粘贴刚刚保存的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> 回车
Configuration complete.
Options:
- type: webdav
- url: https://wani.teracloud.jp/dav/
- vendor: other
- user: itluo
- pass: *** ENCRYPTED ***
Keep this "jpwp" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>回车
Current remotes:
Name Type
==== ====
jpwp 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 //退出配置
挂载磁盘
[root@ SEEK ~]# mkdir /mnt/TeraCloud //新建磁盘挂载目录
[root@ SEEK ~]# rclone mount TeraCloud : /mnt/TeraCloud --config=/root/.config/rclone/rclone.conf --allow-other --allow-non-empty --vfs-cache-mode full --vfs-cache-max-age 48h --vfs-cache-max-size 5G --cache-dir /tmp/cache --vfs-read-chunk-size 128M --vfs-read-chunk-size-limit 1G --buffer-size 128M --umask 000 &
//挂载 TeraCloud 到 /mnt/TeraCloud 目录
检查,输入df -h
显示磁盘空间使用情况
[root@SEEK ~]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 2.0G 0 2.0G 0% /dev
tmpfs 2.0G 12K 2.0G 1% /dev/shm
tmpfs 2.0G 201M 1.8G 11% /run
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
/dev/vda1 21G 7.7G 12G 39% /
tmpfs 393M 0 393M 0% /run/user/0
TeraCloud: 1.0P 0 1.0P 0% /mnt/TeraCloud
看到显示你挂载的网盘则成功,其他网盘同理可挂载
空空如也!