安装依赖

CentOS: yum -y install wget unzip screen fuse fuse-devel
Ubuntu/Debian: apt-get install -y nload htop fuse p7zip-full

1.使用脚本安装
curl https://rclone.org/install.sh | sudo bash

2.运行Rclone开始配置
rclone config

3.第一步选择n,然后回车输入一个name

No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>test

4.选择挂载的类型

10 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
11 / Google Drive
\ "drive"
12 / Hubic
\ "hubic"

5.留空回车直到Use auto config选择n

Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> n

6.rclone终端内回显一个GoogleDrive的授权登录地址,使用浏览器登陆并允许
回到终端输入授权码回车下一步

If your browser doesn't open automatically go to the following
link: https://accounts.google.com/o/oauth2/auth?access_type=
offline&client_id=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Log in and authorize rclone for access
Enter verification code>

7.(可选)谷歌团队网盘使用

Configure this as a team drive?
y) Yes
n) No
y/n>

8.选择y

y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d>y

9.选择q退出

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

10.创建挂载目录

mkdir /mnt/googledrive

11.输入命令挂载

rclone mount test: /mnt/googledrive --allow-other --allow-non-empty --vfs-cache-mode writes --daemon
rclone mount test: /mnt/googledrive --allow-other --allow-non-empty --vfs-cache-mode full --vfs-cache-max-age 12h --daemon

设置writes模式,缓存大小,缓存时间。

rclone mount test: /mnt/googledrive --allow-other --allow-non-empty --vfs-cache-mode writes --vfs-cache-max-size 10G --vfs-cache-max-age 2h --daemon

--vfs-cache-mode full 读写模式 读出写入全部缓存在磁盘
--vfs-cache-mode writes 这种模式下打开文件读取时,仍然是直接从远端读取,写入文件会先被缓存到磁盘。
--vfs-cache-max-age 12h 12小时后清除缓存在磁盘的数据
--vfs-cache-max-size 10G 缓存阈值为10G
--daemon进程守护选项,可后台运行

#下面代码是一个整体,全部复制后粘贴运行
/usr/bin/rclone mount DriveName:Folder LocalFolder \
--umask 0000 \
--default-permissions \
--allow-non-empty \
--allow-other \
--transfers 1 \
--buffer-size 64M \
--low-level-retries 200
#如果你还涉及到读取使用,比如使用H5ai等在线播放,就在后面多加上以下三条参数
--dir-cache-time 12h
--vfs-read-chunk-size 32M
--vfs-read-chunk-size-limit 1G

相关链接: https://rclone.org/commands/rclone_mount/

分类: Main

0 条评论

发表评论

邮箱地址不会被公开。 必填项已用*标注