宝塔面板利用rclone挂载onedrive,sharepoint到自己的vps服务器上

昨天说了如何利用rclone挂载世纪互联到自己的本地电脑上,今天说下如何挂载onedrive,sharepoint到linux服务器上。目前rclone的最新版本1.54.0已经正式支持世纪互联和sharepoint。教程基于宝塔安装(宝塔服务器面板,一键全能部署及管理,送你3188元礼包,点我领取https://www.bt.cn/?invite_code=MV9ub2NxdmI=

目前的最新版下载等,请参考前文:windows10:Rclone官方版1.54.0挂载世纪互联(含sharepoint)到本地磁盘

1、部署

1)CentOS系统安装rclone就很简单了,使用官方的安装命令即可,debian等也是一样。

  1. curl https://rclone.org/install.sh | sudo bash

2)CentOS挂载Onedrive

因为接下来操作方法和windows完全一样,唯一的区别是“Use auto config?”这里选择n,并输入之前获取的token

  1. Remote config
  2. Use auto config?
  3. * Say Y if not sure
  4. * Say N if you are working on a remote or headless machine
  5. y) Yes (default)
  6. n) No
  7. y/n> n #这里选择n
  8. For this to work, you will need rclone available on a machine that has
  9. a web browser available.
  10.  
  11. For more help and alternate methods see: https://rclone.org/remote_setup/
  12.  
  13. Execute the following on the machine with the web browser (same rclone
  14. version recommended):
  15.  
  16. rclone authorize “onedrive”
  17.  
  18. Then paste the result below:
  19. result> #这里输入之前保存的token

3)如果你忘了自己的token,在windows的cmd中使用如下命令查找路径,找到了rclone.conf文件,打开编辑即可看到token。

  1. rclone config file

4)挂载世纪互联,使用如下命令。

  1. #安装fuse
  2. yum y install fuse
  3. #创建挂载目录
  4. mkdir p /home/onedrive
  5. #挂载
  6. rclone mount onedrive:/ /home/onedrive copylinks nogzipencoding nocheckcertificate allowother allownonempty umask 000 vfscachemode writes

注意,mount后面的onedrive,是你在之前设置的名称,后面的/home/onedrive 是挂载的目录,这个也可以挂载到别的目录。

2、挂载SharePoint

上面挂载好了od,我们在顺手把SharePoint,也挂载好。

1)rclone config

配置的话,还是和之前的一样,具体看步骤吧。

  1. [root@hostf68b156fb8 ~]# rclone config
  2. Current remotes:
  3.  
  4. Name Type
  5. ==== ====
  6. onedrive onedrive
  7.  
  8. e) Edit existing remote
  9. n) New remote
  10. d) Delete remote
  11. r) Rename remote
  12. c) Copy remote
  13. s) Set configuration password
  14. q) Quit config
  15. e/n/d/r/c/s/q> n #新建
  16. name> sharepoint #起一个名字
  17. Type of storage to configure.
  18. Enter a string value. Press Enter for the default (“”).
  19. Choose a number from below, or type in your own value
  20. 1 / 1Fichier
  21. \ “fichier”
  22. 2 / Alias for an existing remote
  23. \ “alias”
  24. 3 / Amazon Drive
  25. \ “amazon cloud drive”
  26. 4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, and Tencent COS
  27. \ “s3”
  28. 5 / Backblaze B2
  29. \ “b2”
  30. 6 / Box
  31. \ “box”
  32. 7 / Cache a remote
  33. \ “cache”
  34. 8 / Citrix Sharefile
  35. \ “sharefile”
  36. 9 / Compress a remote
  37. \ “compress”
  38. 10 / Dropbox
  39. \ “dropbox”
  40. 11 / Encrypt/Decrypt a remote
  41. \ “crypt”
  42. 12 / Enterprise File Fabric
  43. \ “filefabric”
  44. 13 / FTP Connection
  45. \ “ftp”
  46. 14 / Google Cloud Storage (this is not Google Drive)
  47. \ “google cloud storage”
  48. 15 / Google Drive
  49. \ “drive”
  50. 16 / Google Photos
  51. \ “google photos”
  52. 17 / Hadoop distributed file system
  53. \ “hdfs”
  54. 18 / Hubic
  55. \ “hubic”
  56. 19 / In memory object storage system.
  57. \ “memory”
  58. 20 / Jottacloud
  59. \ “jottacloud”
  60. 21 / Koofr
  61. \ “koofr”
  62. 22 / Local Disk
  63. \ “local”
  64. 23 / Mail.ru Cloud
  65. \ “mailru”
  66. 24 / Mega
  67. \ “mega”
  68. 25 / Microsoft Azure Blob Storage
  69. \ “azureblob”
  70. 26 / Microsoft OneDrive
  71. \ “onedrive”
  72. 27 / OpenDrive
  73. \ “opendrive”
  74. 28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
  75. \ “swift”
  76. 29 / Pcloud
  77. \ “pcloud”
  78. 30 / Put.io
  79. \ “putio”
  80. 31 / QingCloud Object Storage
  81. \ “qingstor”
  82. 32 / SSH/SFTP Connection
  83. \ “sftp”
  84. 33 / Sugarsync
  85. \ “sugarsync”
  86. 34 / Tardigrade Decentralized Cloud Storage
  87. \ “tardigrade”
  88. 35 / Transparently chunk/split large files
  89. \ “chunker”
  90. 36 / Union merges the contents of several upstream fs
  91. \ “union”
  92. 37 / Webdav
  93. \ “webdav”
  94. 38 / Yandex Disk
  95. \ “yandex”
  96. 39 / Zoho
  97. \ “zoho”
  98. 40 / http Connection
  99. \ “http”
  100. 41 / premiumize.me
  101. \ “premiumizeme”
  102. 42 / seafile
  103. \ “seafile”
  104. Storage> 26 #选择26
  105. ** See help for onedrive backend at: https://rclone.org/onedrive/ **
  106.  
  107. OAuth Client Id
  108. Leave blank normally.
  109. Enter a string value. Press Enter for the default (“”).
  110. client_id> #填自己的
  111. OAuth Client Secret
  112. Leave blank normally.
  113. Enter a string value. Press Enter for the default (“”).
  114. client_secret> #填自己的
  115. Choose national cloud region for OneDrive.
  116. Enter a string value. Press Enter for the default (“global”).
  117. Choose a number from below, or type in your own value
  118. 1 / Microsoft Cloud Global
  119. \ “global”
  120. 2 / Microsoft Cloud for US Government
  121. \ “us”
  122. 3 / Microsoft Cloud Germany
  123. \ “de”
  124. 4 / Azure and Office 365 operated by 21Vianet in China
  125. \ “cn”
  126. region> 4 #选择4
  127. Edit advanced config? (y/n)
  128. y) Yes
  129. n) No (default)
  130. y/n> n #选择n
  131. Remote config
  132. Make sure your Redirect URL is set to “http://localhost:53682/” in your custom config.
  133. Use auto config?
  134. * Say Y if not sure
  135. * Say N if you are working on a remote or headless machine
  136. y) Yes (default)
  137. n) No
  138. y/n> n #之前配置过了,所以这里选择n
  139. For this to work, you will need rclone available on a machine that has
  140. a web browser available.
  141.  
  142. For more help and alternate methods see: https://rclone.org/remote_setup/
  143.  
  144. Execute the following on the machine with the web browser (same rclone
  145. version recommended):
  146.  
  147. rclone authorize “onedrive” “a_Mp”
  148.  
  149. Then paste the result below:
  150. result> {#复制自己的token}
  151. Choose a number from below, or type in an existing value
  152. 1 / OneDrive Personal or Business
  153. \ “onedrive”
  154. 2 / Root Sharepoint site
  155. \ “sharepoint”
  156. 3 / Sharepoint site name or URL (e.g. mysite or https://contoso.sharepoint.com/sites/mysite)
  157. \ “url”
  158. 4 / Search for a Sharepoint site
  159. \ “search”
  160. 5 / Type in driveID (advanced)
  161. \ “driveid”
  162. 6 / Type in SiteID (advanced)
  163. \ “siteid”
  164. 7 / Sharepoint serverrelative path (advanced, e.g. /teams/hr)
  165. \ “path”
  166. Your choice> 2 #这里为了演示就选择了2,根据需要自行选择
  167. Found 2 drives, please select the one you want to use:
  168. 0: 表单库tst (documentLibrary) id=b!x
  169. 1: 文档 (documentLibrary) id=b
  170. Chose drive to use:> 0
  171. Found drive ‘root’ of type ‘documentLibrary’, URL:
  172. Is that okay?
  173. y) Yes (default)
  174. n) No
  175. y/n> y #选择y
  176. ——————–
  177. [sharepoint]
  178. type = onedrive
  179. region = cn
  180. token =
  181. drive_type = documentLibrary
  182. ——————–
  183. y) Yes this is OK (default)
  184. e) Edit this remote
  185. d) Delete this remote
  186. y/e/d> y #选择y
  187. Current remotes:
  188.  
  189. Name Type
  190. ==== ====
  191. onedrive onedrive
  192. sharepoint onedrive
  193.  
  194. e) Edit existing remote
  195. n) New remote
  196. d) Delete remote
  197. r) Rename remote
  198. c) Copy remote
  199. s) Set configuration password
  200. q) Quit config
  201. e/n/d/r/c/s/q> q #选择q退出

2)挂载SharePoint

挂载和之前的命令一样,如下:

  1. #创建挂载目录
  2. mkdir p /www/onedrive
  3. #挂载
  4. rclone mount sharepoint:/ /www/sharepoint copylinks nogzipencoding nocheckcertificate allowother allownonempty umask 000 vfscachemode writes

额,这样就挂载好了。

3、守护运行

还没结束,宝塔面板的话我们可以安装一个Supervisor管理器 ,具体部署如下:

1)安装Supervisor管理器,这个软件商店自行搜索安装

2)设置Supervisor管理器,守护之前挂载好的OneDrive。

此处为隐藏的内容!
发表评论并刷新,方可查看

4)运行成功截图

5)效果

我擦,SharePoint挂哪里去了,怎么这么大?

4、卸载

如果要卸载,可以使用rclone config命令来完成。

  1. [root@hostf68b156fb8 ~]# rclone config
  2. Current remotes:
  3.  
  4. Name Type
  5. ==== ====
  6. onedrive onedrive
  7. sharepoint onedrive
  8.  
  9. e) Edit existing remote
  10. n) New remote
  11. d) Delete remote
  12. r) Rename remote
  13. c) Copy remote
  14. s) Set configuration password
  15. q) Quit config
  16. e/n/d/r/c/s/q> d
  17. Choose a number from below, or type in an existing value
  18. 1 > onedrive
  19. 2 > sharepoint
  20. remote> 2
  21. Current remotes:
  22.  
  23. Name Type
  24. ==== ====
  25. onedrive onedrive
  26.  
  27. e) Edit existing remote
  28. n) New remote
  29. d) Delete remote
  30. r) Rename remote
  31. c) Copy remote
  32. s) Set configuration password
  33. q) Quit config
  34. e/n/d/r/c/s/q> q

别忘了,Supervisor管理器 中删除你的守护进程。

5、最后

以上教程都基于rclone最新版本1.54.0安装搭建,喜欢折腾的童鞋可以试试,如果你用来备份,可以试试这个教程:宝塔面板修改OneDrive插件 – 支持备份网站数据至世纪互联

 

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

 收藏 (0) 打赏

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

支付宝扫一扫赞助

微信钱包扫描赞助

未经允许不得转载:趣吧 » 宝塔面板利用rclone挂载onedrive,sharepoint到自己的vps服务器上

分享到: 更多 (0)

热门文章

  • 暂无相关文章
  • 评论 抢沙发

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

    大前端WP主题 更专业 更方便

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

    登录

    忘记密码 ?

    切换登录

    注册

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