Linux下rclone挂载Google Drive的通用流程

2019-08-20T17:08:00

前言
之前也转发过相关文章,感觉太复杂,看起来有点费话太多了,所以重新来记录下挂载的配置全过程。

2019/08/20 08:40:52 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/s/q> n
#选择新建远程目录配置

name> gd
#起个名称

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 / A stackable unification remote, which can appear to merge the contents of several remotes
   \ "union"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Dropbox
   \ "dropbox"
 9 / Encrypt/Decrypt a remote
   \ "crypt"
10 / FTP Connection
   \ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
12 / Google Drive
   \ "drive"
13 / Hubic
   \ "hubic"
14 / JottaCloud
   \ "jottacloud"
15 / Koofr
   \ "koofr"
16 / Local Disk
   \ "local"
17 / Mega
   \ "mega"
18 / Microsoft Azure Blob Storage
   \ "azureblob"
19 / Microsoft OneDrive
   \ "onedrive"
20 / OpenDrive
   \ "opendrive"
21 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
22 / Pcloud
   \ "pcloud"
23 / QingCloud Object Storage
   \ "qingstor"
24 / SSH/SFTP Connection
   \ "sftp"
25 / Webdav
   \ "webdav"
26 / Yandex Disk
   \ "yandex"
27 / http Connection
   \ "http"
Storage> 12
#选择你的挂载类型,这里google drive

** 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 drive api,可以去谷歌申请,好像有特殊加成

Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret> 
#google drive api授权

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 of the root folder
Leave blank normally.
Fill in to access "Computers" folders. (see docs).
Enter a string value. Press Enter for the default ("").
root_folder_id> 
#如果要挂载某个具体目录就在这里输入目录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
y/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
n) No
y/n> n
#询问是否远程使用机器

If your browser doesn’t open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=20815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=7750fea80af9ecac1e
Log in and authorize rclone for access
Enter verification code> 4/pA*******************************Z6UoDPLF4
#拷贝上面的URL,在浏览器中打开,登录自己的GMAIl账号进行授权,复制授权code过来

Configure this as a team drive?
y) Yes
n) No
y/n> y
#是否配置团队盘

Fetching team drive list...
Choose a number from below, or type in your own value
 1 / public
   \ "0AA*********9PVA"
 2 / temp
   \ "0AE*********9PVA"
Enter a Team Drive ID> 2
#输入你要挂载的团队盘

--------------------
[gd]
type = drive
scope = drive
token = {"access_token":"ya29.GltqB******************************************************************************************eR5dfF10","token_type":"Bearer","refresh_token":"1/kwrvBqViI***********************************s6WjPkZxatA-","expiry":"2019-08-20T09:43:24.169016275Z"}
team_drive = 0AE-*********PVA
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
#配置的最后确认

Current remotes:
Name                 Type
====                 ====
gd                   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
#完成配置退出

官方网站:
https://rclone.org

当前页面是本站的「Baidu MIP」版。发表评论请点击:完整版 »