软件-网盘-OneDrive-Ubuntu 20.04 (abraunegg)
大约 1 分钟约 426 字
软件-网盘-OneDrive-Ubuntu 20.04 (abraunegg)
OneDrive 安装
添加 OpenSuSE Build Service 存储库发布密钥
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/Release.key | sudo apt-key add -
添加 OpenSuSE Build Service 存储库
echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list
更新 apt 包
sudo apt-get update
安装 OneDrive
sudo apt install --no-install-recommends --no-install-suggests onedrive
有 BUG 使用以下链接:issues
首次启动 OneDrive,进行用户绑定
onedrive
- 启动以后,出现
Authorize this app visiting:
,打开链接进行授权(建议关闭梯子进行授权) - 授权以后,复制授权以后的网址到
Enter the response uri:
- 等待 OneDrive 成功连接
- 启动以后,出现
注意:
- 同步位置:
~/OneDrive
Onedrive 操作
操作 1:用户绑定
终端输入
onedrive
,出现以下信息:[user@hostname ~]$ onedrive Authorize this app visiting: https://..... Enter the response uri:
进入
Authorize this app visiting:
后的链接,进行用户登陆授权等登陆到最后,不加载任何东西时,将此页面链接复制到刚刚终端
uri:
下面出现以下界面说明绑定成功:
Application has been successfully authorised, however no additional command switches were provided. Please use 'onedrive --help' for further assistance in regards to running this application.
操作 2:同步特定文件夹
onedrive --sync --single-directory '<dir_name>'
参数解释:
'<dir_name>'
:为 OneDrive 云盘下的文件夹路径文件夹路径例子
Documents/Note/SecondBrain
就是我 Onedrive 下的 Documents 文件夹下 Note 文件夹下的 Secondrain 文件夹保存路径:一般保存到
Home/User_name/Onedrive
文件夹下面快速进行同步操作: 编写脚本运行
#!/bin/bash onedrive --sync --single-directory Documents/Note/SecondBrain
以上脚本是同步特定文件夹下的文件