准备工作1
vps一台
世纪互联版OneDrive账号
以下账号支持25T Sharepoint空间
- Office 365 企业版 E1
- Office 365 企业版 E2
- Office 365 企业版 E3
- Office 365 企业版 E4
- Office 365 企业版 E5
- Office for web 与 SharePoint 计划1
- 使用 SharePoint 计划2的网站的 Office
- SharePoint Online 计划 1
- SharePoint Online 计划 2
- vMicrosoft 365 商业基础版
- Microsoft 365 商业标准版
- Microsoft 365 商业高级版
- Microsoft 365 E3
- Microsoft 365 E5
- Microsoft 365 F1
工具下载
首先在sharepoint管理中心,添加一个网站
下载rclone世纪互联修改版rclone文件下载
将rclone windows版本复制到 系统盘C:/windeos/system32下,并改名为rclone 。
win键+R,打开运行,输入cmd 输入rclone config
接着输入n,对应选项是New remote ,name随意属于自己喜欢的名字,比如pan。
Microsoft Windows [版本 10.0.17763.1457]
(c) 2018 Microsoft Corporation。保留所有权利。
C:\Users\Design>rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> pan #此处输入你喜欢的英文名字,然后回车
Type of storage to configure.
接着选择23 OneDrive
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 / Tardigrade Decentralized Cloud Storage
\ "tardigrade"
32 / Transparently chunk/split large files
\ "chunker"
33 / Union merges the contents of several upstream fs
\ "union"
34 / Webdav
\ "webdav"
35 / Yandex Disk
\ "yandex"
36 / http Connection
\ "http"
37 / premiumize.me
\ "premiumizeme"
38 / seafile
\ "seafile"
Storage> 23 #输入23,为微软网盘OneDrive
在is_21vianet_version输入true
OneDrive operated by 21Vianet (世纪互联 china0sen基于ShadeShady修改).
Enter a boolean value (true or false). Press Enter for the default ("false").
is_21vianet_version> true #国内输入true 国际版OneDrive输入false
这时候输入你在Azure创建的应用ID然后回车,继续输入密码(具体百度,教程很多),应用密匙记得保存,只会在创建的时候显示一次。
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> #这里输入客户端ID
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> #这里输入客户端对应的密码
接在提示Edit advanced config? (y/n)
输入N,提示Use auto config?
输入Y,随后弹出网页进行登录授权。授权完成后输入4回车(需要注意在输入Edit advanced config? (y/n)
后,会有一个本地地址:http://localhost:53682/
,你需要在Azure重定向地址中添加这个地址,否则下一步的登录账号认证会出现错误。在Azure中添加这个地址的意思就是,只有从这个地址申请的权限,才会通过。所以如果没有添加这个地址,登录认证会提示错误)
然后打开这个地址https://od.xkx.me/sp.php 输入相关信息获取siteid,填入id后回车显示磁盘,这时候输入0
Paste your Site ID here> 这里会显示你的网站id
Found 1 drives, please select the one you want to use:
0: 文档 (documentLibrary) id=b!-MuMbpdxtUaEktY9Qoxh61zomIyehfpGnNHMLBacXLtkqsP4edCdQJrFPnyYNzvu
Chose drive to use:> 0 #这里输入0 表示绑定你sp空间文档地址
Found drive 'root' of type 'documentLibrary', URL: #这里会显示sp空间的文档地址,你可以复制下来在浏览器打开,看是否正确
Is that okay?
y) Yes (default)
n) No
y/n> y #输入Y
接着记得复制保存token=
后面的代码
[pan]
type = onedrive
is_21vianet_version = true
client_id = #这里显示你之前输入的id
client_secret = #这里显示你之前输入的信息
token = {"access_token":"eyJ0eXAiOi19+08:00"} #包括``````符号,所有内容。我这里删除了一部分,只展示一点
site_id = #这几项都不管
drive_id = #这几项都不管
drive_type = #这几项都不管,有用的只有token后的代码
--------------------
y) Yes this is OK (default) #这里直接输入Y,默认回车也行
e) Edit this remote
d) Delete this remote
教程上篇到此结束,下一篇是如何部署服务器端的rclone。以及安装aria2点这儿直达下篇
博主你好
我配置好 sharepoint 之后
使用 rclone lsd remote: 显示的却是 onedrive 的文件
....
你遇到过吗
没有,你用了我分享的这个文件吗?这个版本的rclone
Failed to copy: failed to open source object: invalidRequest: The provided item ID is not valid for the requested drive
win和Linux的rclone上传和列表,get size都没有问题,但是从世纪互联sharepoint copy下载时就报错
放system32不如加环境变量
方法多种,适合自己最好