VPS扩容 使用Rclone挂载Google Drive网盘教程

VPS扩容 使用Rclone挂载Google Drive网盘教程

Rclone是一个网盘本地挂载软件,能将全世界多个热门的网盘挂载为系统本地磁盘,实现方便快捷的云盘文件管理效果。搭配无限空间的Google Drive网盘,相当于在电脑上安装了一个无比巨大的磁盘。一般挂载Google Drive的时候,默认是使用的官方提供的api,所以高峰期上传文件的时候,由于很多人在用,导致api的流量上限,会出现各种403ratelimit等错误,最常见的报错提示为:Failed to get file: googleapi: Error 403: Rate Limit Exceeded, rateLimitExceeded,然后目前的解决方法就是使用自己的api。今天和大家分享在VPS上使用Google Drive API挂载Google Drive网盘的方法。

一、安装挂载工具rclone

curl https://rclone.org/install.sh | sudo bash

二、配置rclone

rclone config

name 可以自定义

Choose a number from below, or type in your own value
选谷歌 (13) 可能会因为版本的不同而改变 注意选择 Google drive

client_id> 可以用自己的Google Drive API的client_id,也可以直接回车

关于Google Drive API的client_id和client_secret的获取方法可以参考这个教程?

?获取/启用自己的Google Drive API凭证教程

client_secret> 可以用自己的Google Drive API的client_secret,也可以直接回车

Choose a number from below, or type in your own value
scope> 1 选1 有最大的使用权限。

Enter a string value. Press Enter for the default (“”).
root_folder_id> 直接回车

service_account_file> 直接回车

Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n #不用别的高级配置

Use auto config?

y/n> n

浏览器打开链接登录谷歌账号获取Key

Please go to the following link: https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Log in and authorize rclone for access
Enter verification code>贴入你获取到的key

Configure this as a team drive?
y) Yes
n) No (default)
y/n> 挂载共享网盘选择 y 挂载自己的网盘目录选 n

确认配置是否正确

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


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

三、挂载Google Drive

1.创建一个/GoogleDrive目录,作为挂载目录

mkdir -p /GoogleDrive

2.挂载

/usr/bin/rclone mount GoogleDrive: /GoogleDrive \
 --umask 0000 \
 --default-permissions \
 --allow-non-empty \
 --allow-other \
 --buffer-size 32M \
 --dir-cache-time 12h \
 --vfs-read-chunk-size 64M \
 --vfs-read-chunk-size-limit 1G &

–后面跟的是参数 可以自己调整

如果如下报错内容:

Fatal error: failed to mount FUSE fs: fusermount: exec: “fusermount”: executable file not found in $PATH

Centos解决办法:

yum install fuse -y

Debian/Ubuntu解决办法:

apt-get install fuse -y

3.查看挂载

df -h

4.设置自动挂载和开机自启动

cat > /etc/systemd/system/rclone.service <<EOF
[Unit]
Description=Rclone
AssertPathIsDirectory=LocalFolder
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount GoogleDrive: /GoogleDrive \
 --umask 0000 \
 --default-permissions \
 --allow-non-empty \
 --allow-other \
 --buffer-size 32M \
 --dir-cache-time 12h \
 --vfs-read-chunk-size 64M \
 --vfs-read-chunk-size-limit 1G
ExecStop=/bin/fusermount -u LocalFolder
Restart=on-abort
User=root

[Install]
WantedBy=default.target
EOF

命令执行完毕可以用下面的systemctl命令看来控制rclone挂载

启动

systemctl start rclone

开机启动

systemctl enable rclone

重新启动

systemctl restart rclone

停止

systemctl stop rclone

转载自:https://www.unvone.com/72825.html

技术分享

一款支持Teambition网盘的目录程序|类似于CTlist|简单易用

2020-12-25 11:21:38

技术分享

Cloudreve 3.0个人免费网盘搭建google drive扩容教程

2021-2-6 14:23:44

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索

Warning: error_log(/www/wwwroot/www.yuns.top/wp-content/plugins/spider-analyser/#log/log-1906.txt): failed to open stream: Permission denied in /www/wwwroot/www.yuns.top/wp-content/plugins/spider-analyser/spider.class.php on line 2900