Zander's blog

Welcome To Zander's Blog

0%

云盘及挂载

rclone配置

0.工具准备

1
sudo apt-get install curl

1.下载

https://rclone.org/downloads/

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

2.配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
rclone config

➜ Desktop rclone config
2020/04/17 22:11:34 NOTICE: Config file "/home/zander/.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
n/s/q> n

###输入将要挂载盘的名称,随便取,尽量全英文,不要含中文字符
name> zzrod
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"
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 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / In memory object storage system.
\ "memory"
17 / JottaCloud
\ "jottacloud"
18 / Koofr
\ "koofr"
19 / Local Disk
\ "local"
20 / Mail.ru Cloud
\ "mailru"
21 / Mega
\ "mega"
22 / Microsoft Azure Blob Storage
\ "azureblob"
23 / Microsoft OneDrive
\ "onedrive"
24 / OpenDrive
\ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
26 / Pcloud
\ "pcloud"
27 / Put.io
\ "putio"
28 / QingCloud Object Storage
\ "qingstor"
29 / SSH/SFTP Connection
\ "sftp"
30 / Sugarsync
\ "sugarsync"
31 / Transparently chunk/split large files
\ "chunker"
32 / Union merges the contents of several remotes
\ "union"
33 / Webdav
\ "webdav"
34 / Yandex Disk
\ "yandex"
35 / http Connection
\ "http"
36 / premiumize.me
\ "premiumizeme"


###输入23挂载onedrive
Storage> 23
** See help for onedrive backend at: https://rclone.org/onedrive/ **

Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").

###直接输入回车则使用默认提供的,可以自己添加,具体配置参见https://rclone.org/onedrive/#getting-your-own-client-id-and-key
client_id> 3fa63f81-1993-4fed-883a-xxxxxxx
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").

###添加上面程序对应密钥,如果上面没输入,则此时继续回车默认https://rclone.org/onedrive/#onedrive-client-secret
client_secret> G[9Fb=kC01Vx:qbzb3jOJq-Sbo3zqsNi
Edit advanced config? (y/n)
y) Yes
n) No (default)

###直接回车默认
y/n>
Remote config
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom 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>
If your browser doesnt open automatically go to the following link: http://127.0.0.1:53682/auth?state=-6A0ynF43-ucQ
Log in and authorize rclone for access
Waiting for code...
Got code
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"

###根据上面选择,本次演示挂载企业盘
Your choice> 1
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!c646uCCeYUOMA-oEMjXUqGVa0ADwTZ6jF23uYtHG
Chose drive to use:> 0
Found drive 'root' of type 'business', URL: https://rosoft_com/Documents
Is that okay?
y) Yes (default)
n) No

###直接回车默认
y/n>
--------------------
[zzrod]
type = onedrive
client_id = 3fa63f81-197cee8d
client_secret = G[9Fb=kCSqsNi
token = {"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IjRyaS1Dcl9mT3gtMGZEMnpQWlViSXg2LUItY2RFNU5XMlp5bF91emxpSWsiLCJhbGciOiJSUzI1NiIsIng1dCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSIsImtpZCI6IllNRUxIVDBndmIwbXhvU0RvWWZvbWpxZmpZVSJ9.eyJhdWQiOiIwMDfd6zBB-FzhJ1HcJA1S19E0ldcBcOcgzmlPzHhjE1Wzua2EWjwxBVvNZWabln7_PSwGX0VBKz_1MThwfKNLl-XerLOELaIEXPk_wEnnggruJy_hZad8GLy9YrcKI9REfXskOQXBPswQAQ7hcmvKfnRIAA","expiry":"2020-04-17T23:12:47.593525984+08:00"}
drive_id = b!cbh-oEMjXUqGVa0ADwTZ6jF23uYtHG
drive_type = business
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote

###直接回车默认
y/e/d>
Current remotes:

Name Type
==== ====
zzrod onedrive

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config

###输入q退出
e/n/d/r/c/s/q> q

3.挂载

1
2
3
rclone mount zzrod:/ /media/zander/file/online/zzrod --allow-non-empty --vfs-cache-mode writes
###配置详见https://rclone.org/commands/rclone_mount/#options
rclone mount 上个一步输入的云盘名称:云盘挂载路径 本地路径 --allow-non-empty --vfs-cache-mode writes