欢迎光临
我们一直在努力

windows10:Rclone官方版1.54.0挂载世纪互联(含sharepoint)到本地磁盘

 

        Rclone官方版1.54.0已正式支持世纪互联(含sharepoint),现在安装已经不需要啥魔改版本了。具体的rclone介绍就不多做解释了,这里就直接开始挂载。如果喜欢挂载到vps上,可以看看这个教程:宝塔面板利用rclone挂载onedrive,sharepoint到自己的vps服务器上

1、简介

目前最新版本是1.54.0,已经正常支持世纪互联(含sharepoint)!

官网:https://rclone.org/

项目:https://github.com/rclone/rclone

下载:https://github.com/rclone/rclone/releases

2、windonws10安装rclone

1)Windows客户端:rclone-v1.54.0-windows-amd64

2)下载后将其解压,并将rclone.exe移动到C:\Windows\System32这个目录,这样就可以使用rclone命令了,如下截图。

查询版本命令:rclone -V,可以在cmd中查询,也可以在powershell中查询。

 
  1. PS C:\WINDOWS\system32> rclone -V
  2. rclone v1.54.0
  3. - os/arch: windows/amd64
  4. - go version: go1.15.7

3)在cmd窗口继续输入命令rclone config进行配置,输入n新建一个远程,并取一个名字,比如od

 
  1. PS C:\WINDOWS\system32> rclone config
  2.  
  3. e) Edit existing remote
  4. n) New remote
  5. d) Delete remote
  6. r) Rename remote
  7. c) Copy remote
  8. s) Set configuration password
  9. q) Quit config
  10. e/n/d/r/c/s/q> n

4)输入名称后,找到OneDrive,目前最新版1.54.0,od序号是26,不是固定的,会随着版本号改变。

 
  1. C:\Users\daniao>rclone config
  2. No remotes found - make a new one
  3. n) New remote
  4. s) Set configuration password
  5. q) Quit config
  6. n/s/q> n
  7. name> od
  8. Type of storage to configure.
  9. Enter a string value. Press Enter for the default ("").
  10. Choose a number from below, or type in your own value
  11. 1 / 1Fichier
  12. \ "fichier"
  13. 2 / Alias for an existing remote
  14. \ "alias"
  15. 3 / Amazon Drive
  16. \ "amazon cloud drive"
  17. 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, and Tencent COS
  18. \ "s3"
  19. 5 / Backblaze B2
  20. \ "b2"
  21. 6 / Box
  22. \ "box"
  23. 7 / Cache a remote
  24. \ "cache"
  25. 8 / Citrix Sharefile
  26. \ "sharefile"
  27. 9 / Compress a remote
  28. \ "compress"
  29. 10 / Dropbox
  30. \ "dropbox"
  31. 11 / Encrypt/Decrypt a remote
  32. \ "crypt"
  33. 12 / Enterprise File Fabric
  34. \ "filefabric"
  35. 13 / FTP Connection
  36. \ "ftp"
  37. 14 / Google Cloud Storage (this is not Google Drive)
  38. \ "google cloud storage"
  39. 15 / Google Drive
  40. \ "drive"
  41. 16 / Google Photos
  42. \ "google photos"
  43. 17 / Hadoop distributed file system
  44. \ "hdfs"
  45. 18 / Hubic
  46. \ "hubic"
  47. 19 / In memory object storage system.
  48. \ "memory"
  49. 20 / Jottacloud
  50. \ "jottacloud"
  51. 21 / Koofr
  52. \ "koofr"
  53. 22 / Local Disk
  54. \ "local"
  55. 23 / Mail.ru Cloud
  56. \ "mailru"
  57. 24 / Mega
  58. \ "mega"
  59. 25 / Microsoft Azure Blob Storage
  60. \ "azureblob"
  61. 26 / Microsoft OneDrive
  62. \ "onedrive"
  63. 27 / OpenDrive
  64. \ "opendrive"
  65. 28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
  66. \ "swift"
  67. 29 / Pcloud
  68. \ "pcloud"
  69. 30 / Put.io
  70. \ "putio"
  71. 31 / QingCloud Object Storage
  72. \ "qingstor"
  73. 32 / SSH/SFTP Connection
  74. \ "sftp"
  75. 33 / Sugarsync
  76. \ "sugarsync"
  77. 34 / Tardigrade Decentralized Cloud Storage
  78. \ "tardigrade"
  79. 35 / Transparently chunk/split large files
  80. \ "chunker"
  81. 36 / Union merges the contents of several upstream fs
  82. \ "union"
  83. 37 / Webdav
  84. \ "webdav"
  85. 38 / Yandex Disk
  86. \ "yandex"
  87. 39 / Zoho
  88. \ "zoho"
  89. 40 / http Connection
  90. \ "http"
  91. 41 / premiumize.me
  92. \ "premiumizeme"
  93. 42 / seafile
  94. \ "seafile"
  95. Storage> 26 #这里选择26,其他的可以选择别的序号
  96. ** See help for onedrive backend at: https://rclone.org/onedrive/ **

5)下面就需要输入Client Secret和Client Id,因为站长这里用的是同济的校友,所以需要先输入(如果你还么有,那么这之前的工作就是你要建立一个空全局,教程看这里:世纪互联空全局订阅获取Azure+自建独享API

注意,如果是其他的可以直接略过。

 
  1. OAuth Client Id
  2. Leave blank normally.
  3. Enter a string value. Press Enter for the default ("").
  4. client_id> #这里填入自己的id
  5. OAuth Client Secret
  6. Leave blank normally.
  7. Enter a string value. Press Enter for the default ("").
  8. client_secret> #填入自己的secret
  9. Choose national cloud region for OneDrive.
  10. Enter a string value. Press Enter for the default ("global").

6)选择世纪互联和其他一堆操作。

我们看到序号4,是世纪互联,其他就跟着教程走。这里就不细说了。

 
  1. Choose a number from below, or type in your own value
  2. 1 / Microsoft Cloud Global
  3. \ "global"
  4. 2 / Microsoft Cloud for US Government
  5. \ "us"
  6. 3 / Microsoft Cloud Germany
  7. \ "de"
  8. 4 / Azure and Office 365 operated by 21Vianet in China
  9. \ "cn"
  10. region> 4 #选择4
  11. Edit advanced config? (y/n)
  12. y) Yes
  13. n) No (default)
  14. y/n> n #这里选择n
  15. Remote config
  16. Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
  17. Use auto config?
  18. * Say Y if not sure
  19. * Say N if you are working on a remote or headless machine
  20. y) Yes (default)
  21. n) No
  22. y/n> y #选择y
  23. If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=A_tjjKrdfKTLdPftq9phRw
  24. Log in and authorize rclone for access
  25. Waiting for code...
  26. Got code

7)这之后,会进入登录页面,输入你的账号和密码登录即可,会自动获得token,如果打不开可以把前面的网址换为:https://login.chinacloudapi.cn/common,后面的都不要动。之后的操作如下:

 
  1. Choose a number from below, or type in an existing value
  2. 1 / OneDrive Personal or Business
  3. \ "onedrive"
  4. 2 / Root Sharepoint site
  5. \ "sharepoint"
  6. 3 / Sharepoint site name or URL (e.g. mysite or https://contoso.sharepoint.com/sites/mysite)
  7. \ "url"
  8. 4 / Search for a Sharepoint site
  9. \ "search"
  10. 5 / Type in driveID (advanced)
  11. \ "driveid"
  12. 6 / Type in SiteID (advanced)
  13. \ "siteid"
  14. 7 / Sharepoint server-relative path (advanced, e.g. /teams/hr)
  15. \ "path"
  16. Your choice> 1 #这里选择1,od和sharepoint都是支持的,自己根据需要选择
  17. Found 1 drives, please select the one you want to use:
  18. 0: OneDrive (business) id=b!5sR5nrtytytytytytytyVITcXXmJQaF8EznkrHDU
  19. Chose drive to use:> 0 #选择0
  20. Found drive 'root' of type 'business', URL: https://universitytongji-my.sharepoint.cn/personal/suoquhao_alumni_tongji_edu_cn/Documents
  21. Is that okay?
  22. y) Yes (default)
  23. n) No
  24. y/n> y #选择y

8)之后会出现token等配置,会自动生产配置文件,这里配置好,就算是结束了,下面的工作就是挂载,具体如下:

 
  1. --------------------
  2. [od]
  3. type = onedrive
  4. client_id = a58cc5
  5. client_secret = YQ
  6. region = cn
  7. token = {"access_token":"eyJ0eXAiOiJKV1QiLCJub25jZSI6IjhrZ19JdUR0XzNzaklJanVlb052cFozVjlqWGp5czhRbE03Ym9WYmtkSE0iLCJ0VuE-hIAA","expiry":"2021-02-04T17:41:16.475507+08:00"}
  8. drive_id = b!5sR5nWktPUG
  9. drive_type = business
  10. --------------------
  11. y) Yes this is OK (default)
  12. e) Edit this remote
  13. d) Delete this remote
  14. y/e/d> y #选择y
  15. Current remotes:
  16.  
  17. Name Type
  18. ==== ====
  19. od onedrive
  20.  
  21. e) Edit existing remote
  22. n) New remote
  23. d) Delete remote
  24. r) Rename remote
  25. c) Copy remote
  26. s) Set configuration password
  27. q) Quit config
  28. e/n/d/r/c/s/q> q #选择q退出配置

3、挂载到本地磁盘

1)挂载之前需要下载Winfsp,没有这玩意挂载会出错。

Winfsp下载:https://github.com/billziss-gh/winfsp/releases

下载之后直接安装即可,无需修改安装位置,一路按默认的点下去就可。

2)查找配置好的配置文件可以用如下命令,rclone.conf中有你之后要用到token。

 
  1. rclone config file

使用效果

 
  1. C:\Users\ddd>rclone config file
  2. Configuration file is stored at:
  3. C:\Users\ddd\.config\rclone\rclone.conf

3)打开cmd,输入如下挂载命令。

 
  1. rclone mount od:/ F: --cache-dir D:\Temp\OneDrive --vfs-cache-mode writes

意思就是把od所有文件挂载到F盘符下,缓存存储在D:\Temp\OneDrive下。这个mount后面的onedrive是你之前输入的名字,大鸟这里是od。

看到网上很多教程说需要在Git CMD中输入挂载命令,新版本之后看来不需要了这个了。直接挂载就能看到盘符。

4)挂载成功如下:

 
  1. C:\Users\ddd>rclone mount od:/ F: --cache-dir D:\Temp\OneDrive --vfs-cache-mode writes
  2. The service rclone has been started.

看看截图:

出现了盘符F。

4、开机自动挂载

到这里还没结束,电脑重启后磁盘会消失,下面看看怎么解决。

新建两个文件,分别为rclone.bat和rclone.vbs

1)rclone.bat中写入上述挂载命令:

 
  1. rclone mount od:/ F: --cache-dir D:\Temp\OneDrive --vfs-cache-mode writes

2)rclone.vbs设置开机自动调用cmd运行rclone.bat文件并退出cmd,写入如下代码:

 
  1. CreateObject("WScript.Shell").Run "cmd /c D:/rclone.bat",0

3)将rclone.bat文件放到D盘(或其他的盘)目录下,我放在了D盘,所以在rclone.vbs中该文件的路径就是D:/rclone.bat

4)将rclone.vbs文件放到windows系统启动项目录下,在文件夹的路径框中输入如下代码:即可进入启动项目录

 
  1. %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

至此,onedrive磁盘的挂载完成,且电脑下次开机时onedrive磁盘也不会消失,同理sharepoint同样的挂载方法。

5、最后

挂载后,访问速度不是太快,个人感觉没有微软官方提供的OneDrive程序打开的速度快。配置也很麻烦,其实完全可以用微软官方提供的OneDrive程序来部署。

参考资料:

https://rclone.org/commands/rclone_mount/

https://blog.csdn.net/lb_auto/article/details/105751277

 

本文转自大鸟博客:https://www.daniao.org/12259.html

 收藏 (0) 打赏

您可以选择一种方式赞助本站

支付宝扫一扫赞助

微信钱包扫描赞助

未经允许不得转载:趣吧 » windows10:Rclone官方版1.54.0挂载世纪互联(含sharepoint)到本地磁盘
分享到: 生成海报

热门推荐

    评论 抢沙发

    • QQ号
    • 昵称 (必填)
    • 邮箱 (必填)
    • 网址

    铭宇网络建站 专业 快捷

    联系我们联系我们
    切换注册

    登录

    忘记密码 ?

    切换登录

    注册

    我们将发送一封验证邮件至你的邮箱, 请正确填写以完成账号注册和激活