Ubuntu安装配置rclone(Onedrive应用)
rclone安装
命令行安装
脚本安装
curl https://rclone.org/install.sh | sudo bash
# 或者
curl https://rclone.org/install.sh | sudo bash -s beta # 测试版
源文件安装
从预编译二进制文件安装:curl命令可换为wget、axel,当然也可以直接(浏览器)手动下载
# 1. 获取源文件并解压缩,然后切换到解压目录
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-current-linux-amd64.zip
cd rclone-*-linux-amd64
# 2. 复制二进制文件并修改用户(组)权限
sudo cp rclone /usr/bin/
sudo chown root:root /usr/bin/rclone
sudo chmod 755 /usr/bin/rclone
deb包安装
下载对应deb包:https://rclone.org/downloads/
dpkg命令
sudo dpkg -i xxx.deb
sudo apt-get install -f
gdeb命令
sudo apt install gdebi-core # 安装第三方工具
sudo gdebi xxx.deb
rclone配置
获取客户端ID和密钥
在默认情况下执行请求时,rclone使用所有rclone用户共享的一对客户端ID和密钥。
可以按照以下步骤获取自己的客户ID和密钥:
- 打开https://apps.dev.microsoft.com/#/appList ,然后单击添加应用(Add an app) 。
- 输入应用的名称,然后点击“继续”。 应记下应用程序 ID(Application Id)以便配置中使用。
- 在“应用程序机密(Application Secrets)”下,单击“ 生成新密码(Generate New Password)“ ,系统会随即机生成一段密码。注意:此密码只出现一次,应立即复制并保存该密码以便配置中使用。
- 在”平台(Platforms)“下,单击“添加平台(Add platform)” ,然后单击
Web。 在”重定向URL(Redirect URLs)“输入http://localhost:53682/。 - 在”Microsoft Graph 权限(Microsoft Graph Permissions)“下 ,添加委派的权限(delegated permissions):
Files.Read,Files.ReadWrite,Files.Read.All,Files.ReadWrite.All,offline_access,User.Read。 - 滚动到底部,然后单击“ 保存(Save)“ 。
下图是完成后的截图示例:

配置向导
配置示例:
客户端id: 399f84a2-32f5-47fa-a866-d415078a91d9
密钥:heq****************************
bl@bl:~$ 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 # 新建选择 n (我已经配置过了1个,所以多了几个选项)
name> myod # 自定义配置名称
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 / A stackable unification remote, which can appear to merge the contents of several remotes
\ "union"
2 / Alias for a 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 / Dropbox
\ "dropbox"
9 / Encrypt/Decrypt a remote
\ "crypt"
10 / FTP Connection
\ "ftp"
11 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
12 / Google Drive
\ "drive"
13 / Hubic
\ "hubic"
14 / JottaCloud
\ "jottacloud"
15 / Koofr
\ "koofr"
16 / Local Disk
\ "local"
17 / Mega
\ "mega"
18 / Microsoft Azure Blob Storage
\ "azureblob"
19 / Microsoft OneDrive
\ "onedrive"
20 / OpenDrive
\ "opendrive"
21 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
22 / Pcloud
\ "pcloud"
23 / QingCloud Object Storage
\ "qingstor"
24 / SSH/SFTP Connection
\ "sftp"
25 / Webdav
\ "webdav"
26 / Yandex Disk
\ "yandex"
27 / http Connection
\ "http"
Storage> 19 # 输入OneDrive对应的编号
** See help for onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> 399f84a2-32f5-47fa-a866-d415078a91d9 # 应用/客户端id
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> heq************************ # 密码/密钥
Edit advanced config? (y/n)
y) Yes
n) No
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
n) No
y/n> y # y, 同意自动配置,(浏览器会自动重定向本地请求授权,成功返回“Success! All done. Please go back to rclone.”)
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1 # 1,Onedrive个人或者商业版
Found 1 drives, please select the one you want to use:
0: (personal) id=7bbf0a5dc86d77be
Chose drive to use:> 0 # 0
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=7bbf0a5dc86d77be
Is that okay?
y) Yes
n) No
y/n> y # y, 确认版本
--------------------
[myod]
type = onedrive
client_id = 399f84a2-32f5-47fa-a866-d415078a91d9
client_secret = heq****************************
token = {"access_token":"token,通过~/.config/rclone/rclone.conf文件也可以查看","expiry":"2019-04-27T03:12:32.874487926+08:00"}
drive_id = 7bbf0a5dc86d77be
drive_type = personal
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y # y, 确认配置
Current remotes:
Name Type
==== ====
myod onedrive
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 # q, 退出
测试连接
bl@bl:~$ rclone lsd onedrive:
-1 2017-06-12 19:00:15 1 Office Online 扩展
-1 2019-04-26 23:51:59 5 oucbl
-1 2019-04-26 01:02:53 2 图片
-1 2019-02-26 04:03:36 9 文档
-1 2017-01-11 22:17:39 0 电子邮件附件
$ rclone lsd onedrive: # 查看当前网盘的目录。(有时候网络不稳定,需要多试几次)
onedrive是rclone配置名,需要修改为自己的配置名称
挂载Onedrive
普通用户权限也可以挂载成功,只是使用过程中可能出现一些问题,具体没深入研究;这里就直接使用管理权限。
有教程推荐使用 screen 在后台运行挂载命令,较稳定一点;这里就不说明了。
挂载远程目录到本地
示例:远程网盘目录oucbl挂载到本地/home/bl/One-Drive下:
bl@bl:~$ sudo rclone mount onedrive:/oucbl /home/bl/One-Drive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
相关参数解释如下:
- --copy-links - 显示软链接内容
- --no-gzip-encoding - 不使用 gzip-encoding
- --no-check-certificate - 不验证ssl证书
- --allow-other - 允许其它用户访问
- --allow-non-empty - 允许挂载目录非空
- --umask 000 - 覆写文件掩码为 000
更多参数选项请参考官方文档:https://rclone.org/commands/rclone_mount/
停止挂载
一般情况下使用Ctrl+C便可停止挂载,如果停止失败,使用如下命令停止挂载(本地/home/bl/One-Drive):
bl@bl:~$ sudo fusermount -qzu /home/bl/One-Drive #停止挂载
备注
1T Onedrive教育申请:https://products.office.com/en-us/student?tab=students
鉴于网络问题,暂不打算常用,这里不做开机自启配置了,具体可在参考里面2个博客中查看。
另一个免费OneDrive客户端:onedrive
github: https://github.com/skilion/onedrive
教程示例:https://www.maketecheasier.com/sync-onedrive-linux/
参考
rclone-rsunc for cloud storage--Configure
rclone-rsunc for cloud storage--Microsoft OneDrive
Ubuntu 18.04 手动安装 rclone 并自动挂载 Google Drive
https://timelate.com/archives/install-rclone-on-ubuntu.html#cl-11
Linux下rclone简单教程(支持VPS数据同步,多种网盘,支持挂载)
https://ymgblog.com/2018/03/09/296/
Ubuntu安装配置rclone(Onedrive应用)的更多相关文章
- Ubuntu安装配置protobuf 2.5
Ubuntu安装配置protobuf 2.5 一.安装配置环境 Linux 1.安装protobuf 下载文件 https://github.com/protocolbuffers/protobuf/ ...
- [转载]Ubuntu安装配置 git 服务器和客户端
原文地址:Ubuntu安装配置 git 服务器和客户端作者:ding404 1.配置前准备 服务器:安装ssh server另外还装了gitosis做git的权限管理 sudo apt-get ins ...
- ubuntu 安装配置 JDK7和Android Studio(apt-get方式)
Ubuntu 安装配置JKD 7 $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get ...
- Ubuntu 安装配置MySQL,并使用VS的Server Explorer UI界面远程管理MySQL
为安装配置方便,使用root账号登入Ubuntu. step1: 键入下面命令安装MySQL. 过程十分简单.安装过程中只需根据提示输入root账号的密码即可. step2:安装完成后检查MySQL是 ...
- 英文版Ubuntu安装配置搜狗拼音输入法
下载搜狗输入法 1 进入搜狗输入法官网,进入上面导航兰的 "输入法Linux版" 2 根据你安装的ubuntu是32位还是64位下载 END ubuntu安装搜狗输入法 1 进 ...
- UBuntu安装配置记录
记得是06年左右第一次安装的 Linux,当时是下载的 Fedora镜像,版本已经记不清了,在商业街的电脑维修店刻的盘,回来后兴冲冲地和XP一起安装的双系统.其实就是直接的体验了一把,只是看了看X-W ...
- Ubuntu安装配置Qt 4.86环境
安装 QT4.8.6库+QT Creator 2.4.1 下载地址公布 QT4.8.6库 http://mirrors.hustunique.com/qt/official_releases/qt/ ...
- Ubuntu安装配置Tensorflow-GPU
Ubuntu 16.04 + GTX 1080 Ti + CUDA 9.0 + Cudnn 7.1 安装配置 1. 安装显卡驱动 首先查看一下自己的电脑需要怎样的驱动,我们可以先到 http://ww ...
- ubuntu安装配置jdk tomcat mysql ...
安装之前大家一定要检查好各个版本问题 以免造成不兼容. (一)下载所需安装包: jdk-7u76-linux-x64.tar.gz apache-tomcat-7.0.63.tar.gz MySQL- ...
随机推荐
- Win 10安装Python及环境变量配置
一.Windows系统 很多童鞋问之前的教程怎么没有介绍安装python3.5的,现予以补充更新一下. (一)安装python3.5 1.下载 进入Python官网www.python.org,在“D ...
- java基础---->多线程之interrupt(九)
这里我们通过实例来学习一下java多线程中关于interrupt方法的一些知识.执者失之.我想当一个诗人的时候,我就失去了诗,我想当一个人的时候,我就失去了我自己.在你什么也不想要的时候,一切如期而来 ...
- JQuery事件e参数的方法preventDefault()取消默认行为
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <m ...
- CRUX下实现进程隐藏(3)
通过一个内核模块拦截文件系统的回调函数来实现进程隐藏. VFS(Virtual File System)是Linux在实际文件系统(如ext3,ext4,vfat等)上抽象出的一个文件系统模型,简单来 ...
- 1.Math函数对象
// 属性 Math.E //自然对数的底数(2.718281828459045) Math.PI //圆周率(3.141592653589793) Math.LN2 //2的自然对数(0.69314 ...
- mysql存储过程基础示例
转自:http://database.51cto.com/art/201608/516661.htm http://www.cnblogs.com/mark-chan/p/5384139.html D ...
- 310实验室(六)CMake学习心得
树形结构方式布局. OTL 中每一个文件中的CMakeLists.txt 有不同的作用:按查看文件的先后顺便进行分层理解, 根文件即第一次 中的.txt是 启用 CMAKE_MODULE_PATH模板 ...
- .NET截取指定长度字符超出部分以"..."代替
/// <summary> /// 将指定字符串按指定长度进行剪切, /// </summary> /// <param name= "Str "&g ...
- CH1602 The XOR Largest Pair【Trie树】
1602 The XOR Largest Pair 0x10「基本数据结构」例题 描述 在给定的N个整数A1,A2……AN中选出两个进行xor运算,得到的结果最大是多少? 输入格式 第一行一个整数N, ...
- Tfs 2015 代理池配置笔记
Tfs的构建代理池其实是在代理服务器上开启一个TFSBuild的代理服务,配好相关的Tfs地址后,就能在Tfs管理界面看到了. 如果是Tfs服务和发布代理是同一台服务器,具体操作详见: 安装TFS20 ...