前言:
无聊有小伙伴问我rclone的问题,我就查询了一下相关信息,用rclone挂载Google云盘的教育团队盘,无限存储,可以把plex&emby当媒体的存储库,是个很不错的选择,但是我体验了一下,使用的费用并不低。
Google教育团队盘,带有媒体的是一笔开销费用,此次教程中使用的是我白嫖来的,我询问了价格是125元,身处国外的小伙伴花上125元就可以享受海量的媒体库,是一个不错的选择,但是在国内你还要花上一笔网络费用,这里我就不说是什么了,大家都是老司机我就不多说了。
教程:
准备条件:
Google Drive教育团队账号一个 | 特殊线路 |
unraid一台,,,,,,,这是废话?
安装:Rclone 插件
在unraid的apps商店中搜索Rclone插件,无脑安装,不要安装bate版本,安装稳定的版本。
安装:User Scripts
很多人看到关于挂载Google团队盘的教程大部分都是在群晖,还有其他Linux上看到的,但是在unraid上,我们需要借助此插件在系统开机的时候启动自动挂载脚本,在我们重启unraid或者是关机的时候卸载掉挂载的路径。
也是一样我们在apps商店里面安装此插件。
配置:rclone
在unraid右上角,ssh图标登陆ssh界面输入命令开始配置rclone:
root@Tower:~# rclone config rclone配置命令 No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n #选择n新加 name> googledrive Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / 1Fichier "fichier" 此处忽略。。。。。。 12 / Google Cloud Storage (this is not Google Drive) "google cloud storage" 13 / Google Drive #id 13是Google Drive "drive" 此处忽略。。。。。。 Storage> 13 #输入Google Drive的id ** See help for drive backend at: https://rclone.org/drive/ ** Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance. Enter a string value. Press Enter for the default (""). client_id> #直接回车 Google Application Client Secret Setting your own is recommended. Enter a string value. Press Enter for the default (""). client_secret> #直接回车 Scope that rclone should use when requesting access from drive. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder. "drive" 2 / Read-only access to file metadata and file contents. "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. "drive.metadata.readonly" scope> 1 #次数数日id 1 ID of the root folder Leave blank normally. Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point. Enter a string value. Press Enter for the default (""). root_folder_id> #直接回车 Service Account Credentials JSON file path Leave blank normally. Needed only if you want use SA instead of interactive login. Enter a string value. Press Enter for the default (""). service_account_file> #直接回车 Edit advanced config? (y/n) y) Yes n) No (default) y/n> n #输入n回车 Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes (default) n) No y/n> n #输入n回车 Please go to the following link: https://xxx.com/o/oauth2/auth? #复制此处的url地址到浏览器访问获取code(注意这里的地址是示例,复制你自己ssh上的地址) Log in and authorize rclone for access Enter verification code> 到这里,把link:后年的url 复制到浏览器中访问,按照下面进行操作,获取code![]()
这里注意:不是所有的账号都有认证!
![]()
![]()
以上图片操作流程只是演示!
Enter verification code> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx #获取到的code粘贴回来回车 Configure this as a team drive? y) Yes n) No (default) y/n> y #输入y加载团队盘 Fetching team drive list... Choose a number from below, or type in your own value 1 / homenet6精英nas盘 "0AAf4VA" Enter a Team Drive ID> 1 #选择你的团队盘这里显示的输入的是1 -------------------- [googledrive] type = drive scope = drive token = {"access_token":"","expiry":"2020-08-22T21:09:51.956248626+08:00"} team_drive = -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y #输入y完成 Current remotes: Name Type ==== ==== googledrive drive 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 #输入q退出配置
输入命令:
rclone lsd 配置的团队盘名字: #注意后面有冒号
可以看到团队盘的内容就ok了,我们就可以进行下一步了。
rclone插件配置:
我们在插件页面进入rclone的配置界面。
把脚本预制的内容全部清空,使用下面的脚本:
#!/bin/bash #---------------------------------------------------------------------------- #first section makes the folders for the mount in the /mnt/disks folder so docker containers can have access #there are 4 entries below as in the video i had 4 remotes amazon,dropbox, google and secure #you only need as many as what you need to mount for dockers or a network share mkdir -p /mnt/disks/google #创建目录 #This section mounts the various cloud storage into the folders that were created above. rclone mount --max-read-ahead 1024k --allow-other googledrive: /mnt/disks/google & #挂载命令 注意googledrive还有后面的路径要更换成你自己的
注意:红色部分在粘贴进去后要删掉!!!
配置好内容后点击apply 生效,然后点击MOVE TO USER SCRIPTS
我们在选择卸载脚本:
使用下面的脚本,把内容粘贴进去:
#!/bin/bash
#----------------------------------------------------------------------------
fusermount -u /mnt/disks/google #路径写你上面挂载的路径
配置好内容后点击apply 生效,然后点击MOVE TO USER SCRIPTS
注意,这两份脚本都是可以多路径挂载,一行一条!!!
到此rclone配置完成。
user scrpts:配置
我们在rclone的插件移动过来了两个脚本。分别是挂载脚本和卸载脚本!
我们在挂载脚本上点击后运行,然后在ssh界面使用命令查看我们挂载的目录上是否有Google云盘的文件!
可以看到内容,就代表文件已经挂载完成。
我们继续配置开机启动,和关机重启卸载。
这样就可以做到开机自动挂载Google团队盘,关机或者重启自动卸载团队盘了。
结尾:
此教程难度不高,大家直接照抄即可,教程中红色的备注仔细看,脚本中的路径是可以进行变更的,不是固定的,如果还有什么问题,可以在下面留言,或者qq群与我联系
请登录后查看评论内容