前情提要:这位老哥里面写的教程,因为rclone更新了所以有点不一样了,仅作记录
在本地(带浏览器)操作
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
Enter name for new remote.
name> od
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (s3)
5 / Backblaze B2
\ (b2)
6 / Better checksums for other remotes
\ (hasher)
7 / Box
\ (box)
8 / Cache a remote
\ (cache)
9 / Citrix Sharefile
\ (sharefile)
10 / Combine several remotes into one
\ (combine)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / HTTP
\ (http)
20 / Hadoop distributed file system
\ (hdfs)
21 / HiDrive
\ (hidrive)
22 / ImageKit.io
\ (imagekit)
23 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Linkbox
\ (linkbox)
28 / Local Disk
\ (local)
29 / Mail.ru Cloud
\ (mailru)
30 / Mega
\ (mega)
31 / Microsoft Azure Blob Storage
\ (azureblob)
32 / Microsoft Azure Files
\ (azurefiles)
33 / Microsoft OneDrive
\ (onedrive)
34 / OpenDrive
\ (opendrive)
35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
36 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
37 / Pcloud
\ (pcloud)
38 / PikPak
\ (pikpak)
39 / Proton Drive
\ (protondrive)
40 / Put.io
\ (putio)
41 / QingCloud Object Storage
\ (qingstor)
42 / Quatrix by Maytech
\ (quatrix)
43 / SMB / CIFS
\ (smb)
44 / SSH/SFTP
\ (sftp)
45 / Sia Decentralized Cloud
\ (sia)
46 / Storj Decentralized Cloud Storage
\ (storj)
47 / Sugarsync
\ (sugarsync)
48 / Transparently chunk/split large files
\ (chunker)
49 / Union merges the contents of several upstream fs
\ (union)
50 / Uptobox
\ (uptobox)
51 / WebDAV
\ (webdav)
52 / Yandex Disk
\ (yandex)
53 / Zoho
\ (zoho)
54 / premiumize.me
\ (premiumizeme)
55 / seafile
\ (seafile)
Storage> 33
Option client_id.
OAuth Client Id.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_id>
Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret>
Option region.
Choose national cloud region for OneDrive.
Choose a number from below, or type in your own string value.
Press Enter for the default (global).
1 / Microsoft Cloud Global
\ (global)
2 / Microsoft Cloud for US Government
\ (us)
3 / Microsoft Cloud Germany
\ (de)
4 / Azure and Office 365 operated by Vnet Group in China
\ (cn)
region> 1
Edit advanced config?
y) Yes
n) No (default)
y/n>
回车
Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n>
2024/06/12 16:57:22 NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=IjH巴拉巴拉巴拉巴拉巴拉bMZfpA
2024/06/12 16:57:22 NOTICE: Log in and authorize rclone for access
2024/06/12 16:57:22 NOTICE: Waiting for code...
2024/06/12 16:57:41 NOTICE: Got code
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
1 / OneDrive Personal or Business
\ (onedrive)
2 / Root Sharepoint site
\ (sharepoint)
/ Sharepoint site name or URL
3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
\ (url)
4 / Search for a Sharepoint site
\ (search)
5 / Type in driveID (advanced)
\ (driveid)
6 / Type in SiteID (advanced)
\ (siteid)
/ Sharepoint server-relative path (advanced)
7 | E.g. /teams/hr
\ (path)
config_type> 1
我们这里用的是直接挂载,所以选1
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (b!tdo巴拉巴拉巴拉巴拉巴拉N270p--kn巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉uNSJyh9FkDdClz).
1 / OneDrive (business)
\ (b!tdo巴拉巴拉巴拉巴拉巴拉jN270p--knj巴拉巴拉巴拉巴拉巴拉Chg8bDIupzs-GG巴拉巴拉巴拉巴拉巴拉h9FkDdClz)
config_driveid> 1
Drive OK?
Found drive "root" of type "business"
URL: https://巴拉巴拉巴拉巴拉巴拉-my.sharepoint.com/personal/bennyli_巴拉巴拉巴拉巴拉巴拉osoft_com/Documents
y) Yes (default)
n) No
y/n> y
这里有个在浏览器上操作
Configuration complete.
Options:
- type: onedrive
- token: {"access_token":"e这一段是你的token一大堆巴拉巴拉巴拉A","token_type":"Bearer","refresh_token":"0.AXEA4Px6Vm5EHEepvC1qi巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉Vj-Hgd8AgDs_wUA9P-Tp7RFEWyvpyUiBFhqfyIA巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉USii8RQavV-cibNBBUsMJeRhJX5巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉JLvvYO_RoqU8qr0ylsDqTJFcQ_TjosPzFZ1oCmpf9W4hFQMiVIyjGWKihmRydADQkdNP28fqsTQev99b6gpq0mv2_H5WhKapVlG3mhvo6hRL2-I巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉XDYs9Yf1oSZD1u-rf0eI92NHfDgNPkRToRuufMhXo巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉fSgOkp_OnvEN4AeR_TlianFEo4mH8tRuebQYeVBKHc7sH3q1xeT3Ue3-CLzTc_IZkwtsAd7r8oXMKCkUj0A1CrtIt_xVQ7WGHLtkBSyeRVfZaZsYu93Ldh5i2AbD_tFz-jzYiMWCe9SLCO9-d_w7UFIaueJksWy-GOt3kBT6gZn00Y","expiry":"2024-06-12巴拉巴拉巴拉巴拉巴拉巴拉+08:00"}
- drive_id: b!tdoTpA0qSU巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴s-GGAKvWcuNSJyh9FkDdClz
- drive_type: business
Keep this "od" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
这里回车
然后把
{"access_token":"e这一段是你的token一大堆巴拉巴拉巴拉A","token_type":"Bearer","refresh_token":"0.AXEA4Px6Vm5EHEepvC1qi巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉Vj-Hgd8AgDs_wUA9P-Tp7RFEWyvpyUiBFhqfyIA巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉USii8RQavV-cibNBBUsMJeRhJX5巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉JLvvYO_RoqU8qr0ylsDqTJFcQ_TjosPzFZ1oCmpf9W4hFQMiVIyjGWKihmRydADQkdNP28fqsTQev99b6gpq0mv2_H5WhKapVlG3mhvo6hRL2-I巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉XDYs9Yf1oSZD1u-rf0eI92NHfDgNPkRToRuufMhXo巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉巴拉fSgOkp_OnvEN4AeR_TlianFEo4mH8tRuebQYeVBKHc7sH3q1xeT3Ue3-CLzTc_IZkwtsAd7r8oXMKCkUj0A1CrtIt_xVQ7WGHLtkBSyeRVfZaZsYu93Ldh5i2AbD_tFz-jzYiMWCe9SLCO9-d_w7UFIaueJksWy-GOt3kBT6gZn00Y","expiry":"2024-06-12巴拉巴拉巴拉巴拉巴拉巴拉+08:00"}
这一段东西复制出去
下面这个不管它
Current remotes:
Name Type
==== ====
od 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>
第二步 服务器操作
最好用海外的服务器,用国内服务器出现不能操作的问题解决不了
操作类似的
首先安装
curl https://rclone.org/install.sh | sudo bash
然后
root@巴拉巴拉:~# rclone config
2024/06/12 17:03:23 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
Enter name for new remote.
name> od
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (s3)
5 / Backblaze B2
\ (b2)
6 / Better checksums for other remotes
\ (hasher)
7 / Box
\ (box)
8 / Cache a remote
\ (cache)
9 / Citrix Sharefile
\ (sharefile)
10 / Combine several remotes into one
\ (combine)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / HTTP
\ (http)
20 / Hadoop distributed file system
\ (hdfs)
21 / HiDrive
\ (hidrive)
22 / ImageKit.io
\ (imagekit)
23 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Linkbox
\ (linkbox)
28 / Local Disk
\ (local)
29 / Mail.ru Cloud
\ (mailru)
30 / Mega
\ (mega)
31 / Microsoft Azure Blob Storage
\ (azureblob)
32 / Microsoft Azure Files
\ (azurefiles)
33 / Microsoft OneDrive
\ (onedrive)
34 / OpenDrive
\ (opendrive)
35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
36 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
37 / Pcloud
\ (pcloud)
38 / PikPak
\ (pikpak)
39 / Proton Drive
\ (protondrive)
40 / Put.io
\ (putio)
41 / QingCloud Object Storage
\ (qingstor)
42 / Quatrix by Maytech
\ (quatrix)
43 / SMB / CIFS
\ (smb)
44 / SSH/SFTP
\ (sftp)
45 / Sia Decentralized Cloud
\ (sia)
46 / Storj Decentralized Cloud Storage
\ (storj)
47 / Sugarsync
\ (sugarsync)
48 / Transparently chunk/split large files
\ (chunker)
49 / Union merges the contents of several upstream fs
\ (union)
50 / Uptobox
\ (uptobox)
51 / WebDAV
\ (webdav)
52 / Yandex Disk
\ (yandex)
53 / Zoho
\ (zoho)
54 / premiumize.me
\ (premiumizeme)
55 / seafile
\ (seafile)
Storage> 33
Option client_id.
OAuth Client Id.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_id>
Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a value. Press Enter to leave empty.
client_secret>
Option region.
Choose national cloud region for OneDrive.
Choose a number from below, or type in your own string value.
Press Enter for the default (global).
1 / Microsoft Cloud Global
\ (global)
2 / Microsoft Cloud for US Government
\ (us)
3 / Microsoft Cloud Germany
\ (de)
4 / Azure and Office 365 operated by Vnet Group in China
\ (cn)
region> 1
Edit advanced config?
y) Yes
n) No (default)
y/n>
Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/n> n
Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "onedrive" "eyJkZXNjcmlwdGlvbiI6IiJ9"
Then paste the result.
Enter a value.
config_token> {"access_token":"eyJ0eXA这里填入那堆token,要带两边的花括号t3kBT6gZn00Y","expiry":"2024-06-12T17:59:42.4784099+08:00"}
Option config_type.
Type of connection
Choose a number from below, or type in an existing string value.
Press Enter for the default (onedrive).
1 / OneDrive Personal or Business
\ (onedrive)
2 / Root Sharepoint site
\ (sharepoint)
/ Sharepoint site name or URL
3 | E.g. mysite or https://contoso.sharepoint.com/sites/mysite
\ (url)
4 / Search for a Sharepoint site
\ (search)
5 / Type in driveID (advanced)
\ (driveid)
6 / Type in SiteID (advanced)
\ (siteid)
/ Sharepoint server-relative path (advanced)
7 | E.g. /teams/hr
\ (path)
config_type> 1
Option config_driveid.
Select drive you want to use
Choose a number from below, or type in your own string value.
Press Enter for the default (b!巴拉巴拉巴拉巴拉FkDdClz).
1 / OneDrive (business)
\ (b!tdoTpA0qS巴拉巴拉巴拉巴拉Jyh9FkDdClz)
config_driveid> 1
Drive OK?
Found drive "root" of type "business"
URL: https://巴拉巴拉巴拉巴拉-my.sharepoint.com/personal/巴拉巴拉巴拉巴拉i_巴拉巴拉巴拉巴拉crosoft_com/Documents
y) Yes (default)
n) No
y/n>
Configuration complete.
Options:
- type: onedrive
- token: {"access_token":"就是之前那堆东西T6gZn00Y","expiry":"2024-06-12T17:59:42.4784099+08:00"}
- drive_id: b!t巴拉巴拉巴拉巴拉SUWQj巴拉巴拉巴拉巴拉巴拉巴拉SJyh9FkDdClz
- drive_type: business
Keep this "od" remote?
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d>
Current remotes:
Name Type
==== ====
od 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
退出
root@巴拉巴拉巴拉巴拉:~# mkdir /data/onedrive
root@巴拉巴拉巴拉巴拉:~# rclone mount od:/ /data/onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --daemon
root@巴拉巴拉巴拉巴拉:~# cd /data/onedrive
root@巴拉巴拉巴拉巴拉:/data/onedrive# ls
应该就能看到e5里面的文件了