找回密码
 立即注册

QQ登录

只需一步,快速开始

手机号码,快捷登录

手机号码,快捷登录

快捷导航
发帖
首页收藏本站在线全网免费看
系统
[系统通知] 恭喜小麦子 !因在活动表现突出,系统奖励 粉丝秀专属 勋章一枚!(来自 东篱雅苑勋章系统)
2023-01-23
系统
[系统通知] 2023年东篱雅苑祝大家新年快乐!
2023-01-22
系统
[系统通知] 鱼香肉丝表现突出,被那座城任命为创意工坊版主,可喜可贺!
2022-10-29
系统
2022-10-29
系统
2022-10-09
系统
2022-08-21
系统
2022-08-21
系统
2022-08-20
系统
2022-06-28
系统
2022-06-28
系统
[系统通知] 我是阿秀啊表现突出,被那座城任命为PS教程版主,可喜可贺!
2022-05-18
系统
[系统通知] 小麦子表现突出,被那座城任命为灌水园子版主,可喜可贺!
2020-06-11
系统
[系统通知] 小麦子表现突出,被那座城任命为灌水闲谈版主,可喜可贺!
2020-06-11
系统
[系统通知] 冬三愿表现突出,被那座城任命为手游资源综合区版主,可喜可贺!
2020-06-10
系统
[系统通知] 完美表现突出,被那座城任命为任务发布区版主,可喜可贺!
2020-06-03
查看: 7548|回复: 36

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

[复制链接]
族谱关系0
发表于 2021-4-12 21:43:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

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

2.CentOS挂载Onedrive

因为接下来操作方法和windows完全一样,唯一的区别是“Use auto config?”这里选择n,并输入之前获取的token
  • Remote config
  • Use auto config?
  • * Say Y if not sure
  • * Say N if you are working on a remote or headless machine
  • y) Yes (default)
  • n) No
  • y/n> n   #这里选择n
  • 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"
  • Then paste the result below:
  • result>  #这里输入之前保存的token

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

4.挂载世纪互联,使用如下命令。
#安装fuse
yum -y install fuse
#创建挂载目录
mkdir -p /home/onedrive
#挂载
rclone mount onedrive:/ /home/onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode writes

注意,mount后面的onedrive,是你在之前设置的名称,后面的/home/onedrive 是挂载的目录,这个也可以挂载到别的目录。
2、挂载SharePoint
上面挂载好了od,我们在顺手把SharePoint,也挂载好。

1.rclone config

配置的话,还是和之前的一样,具体看步骤吧。
[root@hostf68b156fb8 ~]# rclone config
Current remotes:

Name                 Type
====                 ====
onedrive             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> n  #新建
name> sharepoint  #起一个名字
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 Providers including AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, and Tencent COS
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Citrix Sharefile
   \ "sharefile"
 9 / Compress a remote
   \ "compress"
10 / Dropbox
   \ "dropbox"
11 / Encrypt/Decrypt a remote
   \ "crypt"
12 / Enterprise File Fabric
   \ "filefabric"
13 / FTP Connection
   \ "ftp"
14 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
15 / Google Drive
   \ "drive"
16 / Google Photos
   \ "google photos"
17 / Hadoop distributed file system
   \ "hdfs"
18 / Hubic
   \ "hubic"
19 / In memory object storage system.
   \ "memory"
20 / Jottacloud
   \ "jottacloud"
21 / Koofr
   \ "koofr"
22 / Local Disk
   \ "local"
23 / Mail.ru Cloud
   \ "mailru"
24 / Mega
   \ "mega"
25 / Microsoft Azure Blob Storage
   \ "azureblob"
26 / Microsoft OneDrive
   \ "onedrive"
27 / OpenDrive
   \ "opendrive"
28 / OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
29 / Pcloud
   \ "pcloud"
30 / Put.io
   \ "putio"
31 / QingCloud Object Storage
   \ "qingstor"
32 / SSH/SFTP Connection
   \ "sftp"
33 / Sugarsync
   \ "sugarsync"
34 / Tardigrade Decentralized Cloud Storage
   \ "tardigrade"
35 / Transparently chunk/split large files
   \ "chunker"
36 / Union merges the contents of several upstream fs
   \ "union"
37 / Webdav
   \ "webdav"
38 / Yandex Disk
   \ "yandex"
39 / Zoho
   \ "zoho"
40 / http Connection
   \ "http"
41 / premiumize.me
   \ "premiumizeme"
42 / seafile
   \ "seafile"
Storage> 26 #选择26
** See help for onedrive backend at: https://rclone.org/onedrive/ **

OAuth Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> #填自己的
OAuth Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> #填自己的
Choose national cloud region for OneDrive.
Enter a string value. Press Enter for the default ("global").
Choose a number from below, or type in your own value
 1 / Microsoft Cloud Global
   \ "global"
 2 / Microsoft Cloud for US Government
   \ "us"
 3 / Microsoft Cloud Germany
   \ "de"
 4 / Azure and Office 365 operated by 21Vianet in China
   \ "cn"
region> 4 #选择4
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n  #选择n
Remote config
Make sure your Redirect URL is set to "http://localhost:53682/" in your custom config.
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> n  #之前配置过了,所以这里选择n
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" -- "a_Mp"

Then paste the result below:
result> {#复制自己的token}
Choose a number from below, or type in an existing value
 1 / OneDrive Personal or Business
   \ "onedrive"
 2 / Root Sharepoint site
   \ "sharepoint"
 3 / Sharepoint site name or URL (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"
 7 / Sharepoint server-relative path (advanced, e.g. /teams/hr)
   \ "path"
Your choice> 2  #这里为了演示就选择了2,根据需要自行选择
Found 2 drives, please select the one you want to use:
0: 表单库tst (documentLibrary) id=b!x
1: 文档 (documentLibrary) id=b
Chose drive to use:> 0  
Found drive 'root' of type 'documentLibrary', URL: 
Is that okay?
y) Yes (default)
n) No
y/n> y  #选择y
--------------------
[sharepoint]
type = onedrive
region = cn
token = 
drive_type = documentLibrary
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y #选择y
Current remotes:

Name                 Type
====                 ====
onedrive             onedrive
sharepoint           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退出


2.挂载SharePoint

挂载和之前的命令一样,如下:
#创建挂载目录 
mkdir -p /www/onedrive
#挂载
rclone mount sharepoint:/ /www/sharepoint --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode writes

这样就挂载好了。


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

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

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

rclone-sharepoint-1.png

游客,本帖部分内容(如下载地址)需回复可见,请先回复,方可查看


4.运行成功截图

rclone-sharepoint-3.png

5.效果
rclone-sharepoint-4.png



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

[root@hostf68b156fb8 ~]# rclone config
Current remotes:

Name                 Type
====                 ====
onedrive             onedrive
sharepoint           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> d
Choose a number from below, or type in an existing value
 1 > onedrive
 2 > sharepoint
remote> 2
Current remotes:

Name                 Type
====                 ====
onedrive             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

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






版权声明
1、本主题所有言论和图片纯属会员个人意见,与本论坛立场无关
2、本站所有主题由该帖子作者发表,该帖子作者与东篱雅苑享有帖子相关版权
3、其他单位或个人使用、转载或引用本文时必须同时征得该帖子作者和东篱雅苑的同意
4、帖子作者须承担一切因本文发表而直接或间接导致的民事或刑事法律责任
5、本帖部分内容转载自其它媒体,但并不代表本站赞同其观点和对其真实性负责
6、如本帖侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意,管理员和版主有权不事先通知发贴者而删除本文
族谱关系0
发表于 2021-4-12 21:43:14 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-12 22:53:44 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-12 22:55:06 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-12 23:22:06 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-12 23:32:45 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-13 06:34:05 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-13 07:40:03 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-13 09:31:18 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

族谱关系0
发表于 2021-4-13 13:37:17 | 显示全部楼层
抱歉!您尚未登陆,暂时无法查看回复内容,请点击此处登陆
我要说一句 收起回复
回复 点赞

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

东篱雅苑已运行:| 手机版| 小黑屋| 东篱雅苑

GMT+8, 2024-5-10 22:08