0%

Rclone配置方式

前言:

最近有点沉迷把东西backup到Google drive上,还开了个商业版来方便自己传东西,本文主要是面向0基础的rclone科普教程。主要涉及部分是rclone的安装,rclone配置文件的建立,挂载我不喜欢挂载所以我也不会(

安装:

Linux:

移步官网安装脚本:curl https://rclone.org/install.sh | sudo bash

Windows:

64位:https://downloads.rclone.org/rclone-current-windows-amd64.zip

32位:https://downloads.rclone.org/rclone-current-windows-386.zip

下载过来是个安装包,解压后将rclone.exe放到C:\Windows\System32就好了(当然也可以放在其他目录然后配置环境变量或者每次使用都手动输入rclone全路径)

如果你要挂载rclone上的网盘,windows还需要安装一个依赖项: winfsp

可选下载地址:http://www.secfs.net/winfsp/download/

rclone配置:

打开cmd或者其他终端

如下操作

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
C:\Users\54323>rclone config
Current remotes:

Name Type
==== ====
gd drive
gd2 drive
gd3 drive
my 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> n
#输入n 新建一个remote
name> test
#输入自己想要的名字
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 a 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 / Local Disk
\ "local"
16 / Mega
\ "mega"
17 / Microsoft Azure Blob Storage
\ "azureblob"
18 / Microsoft OneDrive
\ "onedrive"
19 / OpenDrive
\ "opendrive"
20 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
21 / Pcloud
\ "pcloud"
22 / QingCloud Object Storage
\ "qingstor"
23 / SSH/SFTP Connection
\ "sftp"
24 / Webdav
\ "webdav"
25 / Yandex Disk
\ "yandex"
26 / http Connection
\ "http"
Storage> 12
#输入12 回车
** See help for drive backend at: https://rclone.org/drive/ **

Google Application Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id>
#作者注:client_id和client_secret不填的话会使用rclone的api,在高峰期的时候稳定性一般,可以考虑自己建立一个API,但是轻度使用没什么区别
Google Application Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret>
#回车 使用默认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
#填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>
#直接回车
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
#交给rclone自动认证
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&clienxxxxxxxx
Log in and authorize rclone for access
#复制打开上述网址,并且登入你想要的gg账号,然后会获得一个4开头的授权码,粘贴到下方,并且回车
Enter verification code> 4/xxxxxxxB-xxx
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 / seedbox
\ "0Axxxx"
2 / YeZi
\ "0AOxxxx"
Enter a Team Drive ID> 2
#选择一个团队盘
--------------------
[test]
type = drive
scope = drive
token = {"access_token":"xxxxxx","token_type":"xxxx","refresh_token":"xxxx
x","expiry":"2x"}
team_drive = xxxx
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
#展示一下本次配置的信息,没问题就y回车 添加成功
Current remotes:

Name Type
==== ====
gd drive
gd2 drive
gd3 drive
my drive
test 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>

上述操作是在windows下进行的,linux目前方式一样

rclone常用命令:

rclone copy SRC DST

其中SRC指代源文件位置,假设源文件在本地”d:/test” 目的地是test这个网盘的1文件夹

rclone copy d:/test test:1

也可以是从一个网盘到另一个网盘

比如

rclone copy gd1:web gd2:web

在后面加参数–transfer x 可以修改传输进程数 较吃资源

(其他指令我也不知道了

嘛 就酱紫吧 每日上限是单账号750G,所以你可以开一堆小号都加到团队盘里然后换着号上传,copy会自动校验文件创建时间和hash,一般不会出现损坏。

rclone过滤或者仅包括部分文件格式

rclone [filter] [action] [src] [dst] [flag]

filter代指各类过滤规则 包括include exclude

action代指本次需要执行的行为 包括 move copy sync

src dst 为源路径和目的路径

flag为本次运行的其他参数