介绍
Rclone是一个命令行程序,支持不同网盘的同步上传,下载等功能。官方地址
官方地址
注:由于xl只有OneDrive所以这里暂时只提供OneDrive的连接方法
安装Rclone
由于官方有提供一键脚本,所以我们这里采用官方的一键脚本:
curl https://rclone.org/install.sh | sudo bash
Rclone连接OneDrive
获取token
需要在本地电脑下载Rclone选择自己的版本进行安装,文件下载完后解压文件,打开文件夹在文件路径处清空输入cmd即可在此路径打开cmd命令行
下载Rclone
输入一下命令:
rclone authorize "onedrive"
接下来会弹出浏览器,需要登录账号进行授权。授权完后命令提示符窗口会出现以下信息:
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"xxxx"}//”xxxx“是token地址,需要复制,后面需要用到
<---End paste
配置Rclone
输入 rclone config
进行配置
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n //选择新建
name> darkperson //输入你需要的名称
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 / 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 / Google Photos
\ "google photos"
14 / Hubic
\ "hubic"
15 / JottaCloud
\ "jottacloud"
16 / Koofr
\ "koofr"
17 / Local Disk
\ "local"
18 / Mega
\ "mega"
19 / Microsoft Azure Blob Storage
\ "azureblob"
20 / Microsoft OneDrive
\ "onedrive"
21 / OpenDrive
\ "opendrive"
22 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
23 / Pcloud
\ "pcloud"
24 / Put.io
\ "putio"
25 / QingCloud Object Storage
\ "qingstor"
26 / SSH/SFTP Connection
\ "sftp"
27 / Union merges the contents of several remotes
\ "union"
28 / Webdav
\ "webdav"
29 / Yandex Disk
\ "yandex"
30 / http Connection
\ "http"
31 / premiumize.me
\ "premiumizeme"
Storage> 20 //选择OneDrive 如果你是其他网盘可以选择其他选项
** 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 ("").
client_id> //client_id留空
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> //client_secret留空
Edit advanced config? (y/n)
y) Yes
n) No
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
n) No
y/n> n //使用自动配置 n
For this to work, you will need rclone available on a machine that has a web browser available.
Execute the following on your machine (same rclone version recommended) :
rclone authorize "onedrive"
Then paste the result below:
result> {xxxx} //输入上面电脑截取到的token
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 //选择OneDrive 1
Found 1 drives, please select the one you want to use:
0: OneDrive (business) id=b!eiwbIQ_KKkaZfN_oxIfAY8X_HbSY_DlOmzGkcZEDguitWYA4HW7jTbP7quv8qPAM
Chose drive to use:> 0 //检测到一个驱动器 选择编号 0
Found drive 'root' of type 'business', URL: https://xxx-my.sharepoint.com/personal/xxxx/Documents
Is that okay?
y) Yes
n) No
y/n> y //这样配置可以吗? 选择 y
--------------------
[darkperson]
type = onedrive
token = {xxxx}
drive_id = xxxx
drive_type = business
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y //选择 y
Current remotes:
Name Type
==== ====
darkperson onedrive
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就成功连接并挂载到了自己的服务器上!
参考
Rclone官方手册
官方手册