Rclone
Rclone is a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors’ web storage interfaces. Over 70 cloud storage products support rclone including S3 object stores, business & consumer file storage services, as well as standard transfer protocols.
Rclone has powerful cloud equivalents to the unix commands rsync, cp, mv, mount, ls, ncdu, tree, rm, and cat. Rclone’s familiar syntax includes shell pipeline support, and –dry-run protection. It is used at the command line, in scripts or via its API.
Users call rclone “The Swiss army knife of cloud storage”, and “Technology indistinguishable from magic”.
Rclone really looks after your data. It preserves timestamps and verifies checksums at all times. Transfers over limited bandwidth; intermittent connections, or subject to quota can be restarted, from the last good file transferred. You can check the integrity of your files. Where possible, rclone employs server-side transfers to minimise local bandwidth use and transfers from one provider to another without using local disk.
Virtual backends wrap local and cloud file systems to apply encryption, compression, chunking, hashing and joining.
Rclone mounts any local, cloud or virtual filesystem as a disk on Windows, macOS, linux and FreeBSD, and also serves these over SFTP, HTTP, WebDAV, FTP and DLNA.
Rclone is mature, open-source software originally inspired by rsync and written in Go. The friendly support community is familiar with varied use cases. Official Ubuntu, Debian, Fedora, Brew and Chocolatey repos. include rclone. For the latest version downloading from rclone.org is recommended.
Rclone is widely used on Linux, Windows and Mac. Third-party developers create innovative backup, restore, GUI and business process solutions using the rclone command line or API.
Rclone does the heavy lifting of communicating with cloud storage.
Rclone的安装
通过 Rclone 官方脚本安装:
1curl https://rclone.org/install.sh | sudo bash
安装完成后,检查 Rclone 是否已成功安装:
1rclone version
Rclone的配置
Rclone 挂载需要 FUSE 支持,运行以下命令安装:
1sudo apt update
2sudo apt install fuse
3sudo apt install fuse3 #如挂载失败再尝试安装这个
运行配置命令:
1#创建一个本地目录作为挂载点
2mkdir -p ~/189cloud
3rclone config
输入rclone config
开始出现如下选项:
1Name Type
2==== ====
3
4e) Edit existing remote
5n) New remote # 创建新配置
6d) Delete remote
7r) Rename remote
8c) Copy remote
9s) Set configuration password # 为配置设置密码
10q) Quit config
11e/n/d/r/c/s/q> `
按e
选择New remote
1Enter name for new remote.
2name> 189Cloud # 设置名字为'189Cloud'
按Enter
键进入下一步
1Option Storage.
2Type of storage to configure.
3Choose a number from below, or type in your own value.
4
5…….
6
751 / Uptobox
8 \ (uptobox)
952 / WebDAV
10 \ (webdav)
1153 / Yandex Disk
12 \ (yandex)
1354 / Zoho
14 \ (zoho)
1555 / premiumize.me
16 \ (premiumizeme)
1756 / seafile
18 \ (seafile)
19
20Storage>52 # 选择52 WebDAV
按Enter
键进入下一步
1Option url.
2URL of http host to connect to.
3E.g. https://example.com.
4Enter a value.
5url> http(s)://域名(或ip:port)/dav/189cloud ## 设置远程地址http(s)://your_alist_(ip:port)/dav/网盘名 这里在alist的地址和端口后加/dav,是alist官方端口挂载要求的
按Enter
键进入下一步
1Option vendor.
2Name of the WebDAV site/service/software you are using.
3Choose a number from below, or type in your own value.
4Press Enter to leave empty.
5 1 / Fastmail Files
6 \ (fastmail)
7 2 / Nextcloud
8 \ (nextcloud)
9 3 / Owncloud
10 \ (owncloud)
11 4 / Sharepoint Online, authenticated by Microsoft account
12 \ (sharepoint)
13 5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
14 \ (sharepoint-ntlm)
15 6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
16 \ (rclone)
17 7 / Other site/service or software
18 \ (other)
19
20vendor>7 # 选择7即可 Other site/service or software
按Enter
键进入下一步
1Option user.
2User name.
3In case NTLM authentication is used, the username should be in the format 'Domain\User'.
4Enter a value. Press Enter to leave empty.
5user> admin # 这里是alist的用户名
按Enter
键进入下一步
1Option pass.
2Password.
3Choose an alternative below. Press Enter for the default (n).
4y) Yes, type in my own password #是的,输入我自己的密码
5g) Generate random password #生成随机密码
6n) No, leave this optional password blank (default) # 否,将此可选密码留空(默认)
7y/g/n>y #这里输入y
8
9Enter the password:
10password: #这输入你的密码,密码是看不到的
11Confirm the password:
12password: #再次输入你的密码
按Enter
键进入下一步
1Option bearer_token.
2Bearer token instead of user/pass (e.g. a Macaroon).
3Enter a value. Press Enter to leave empty.
4bearer_token> Enter # 这里是填写密钥的,如果没有可以留空,直接按'回车'键
1Edit advanced config?
2y) Yes
3n) No (default)
4y/n>n #默认配置即可
按Enter
键进入下一步
1Configuration complete.
2Options:
3- type: webdav
4- url: http://xxx.xxx.xxx.xxx:5244/dav/天翼云盘
5- vendor: other
6- user: admin
7- pass: *** ENCRYPTED ***
8
9Keep this "189Cloud" remote?
10y) Yes this is OK (default) #是的,我确认默认配置
11e) Edit this remote #编辑配置
12d) Delete this remote #删除配置
13y/e/d> y # 确认配置无误后,按y确认。
按Enter
键进入下一步
1Current remotes:
2Name Type
3==== ====
4189Cloud webdav
5
6e) Edit existing remote
7n) New remote
8d) Delete remote
9r) Rename remote
10c) Copy remote
11s) Set configuration password
12q) Quit config
13
14e/n/d/r/c/s/q> q # 最后按q退出设置
查看天翼云盘是否挂载成功,出现目录即成功:
1rclone lsd 189Cloud:
将天翼云盘挂载到本地目录
1#/path/189cloud为上面步骤已创建的本地目录
2rclone mount 189cloud:/ /path/189cloud --use-mmap --daemon --copy-links --vfs-cache-mode writes
Rclone命令
1rclone copy source:path 189cloud:/ -P