linux上运行onedrive,Linux系统免费OneDrive客户端–OneDrive Free Client

与Linux上的OneDrive交互的完整工具(Free Client for OneDrive on Linux)。支持Fedora、CentOS、Ubuntu、Debian、Arch Linux等操作系统。

特征:

状态缓存

使用Inotify进行实时文件监视

断点续传

支持OneDrive for Business(Office 365的一部分)

共享文件夹(仅OneDrive Personal)

安装依赖

libcurl

SQLite 3

Digital Mars D编译器(DMD)

Ubuntu / Debian

sudo apt install libcurl4-openssl-dev

sudo apt install libsqlite3-dev

# Ubuntu 18+

sudo snap install --classic dmd

# Ubuntu 17 & Debian

sudo wget https://netcologne.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list

sudo apt-get update --allow-insecure-repositories

sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring

sudo apt-get update && sudo apt-get install dmd-compiler

Fedora/CentOS

sudo yum install libcurl-devel

sudo yum install sqlite-devel

curl -fsS https://dlang.org/install.sh | bash -s dmd

Arch Linux

sudo pacman -S curl sqlite dlang

开始安装

git clone https://github.com/skilion/onedrive.git

cd onedrive

make

sudo make install

使用LDC

make DC=ldmd2

首次运行

安装应用程序后,您必须在交互式终端上运行一次以对其进行授权。

onedrive

系统将要求您使用Web浏览器打开特定的链接,在该链接中,您将必须登录到Microsoft帐户,并授予应用程序访问文件的权限。授予权限后,您将被重定向到空白页。将空白页的URI复制到应用程序中。

卸载

sudo make uninstall

# delete the application state from your home directory

rm -rf ~/.config/onedrive

可选配置

配置是可选的。默认情况下,将下载所有文件,~/OneDrive并且仅跳过隐藏文件。如果要更改默认值,可以将包含的配置文件复制并编辑到~/.config/onedrive目录中并进行编辑:

mkdir -p ~/.config/onedrive

cp ./config ~/.config/onedrive/config

nano ~/.config/onedrive/config

可用选项:

sync_dir:文件将被同步到的目录

skip_file:在同步过程中将跳过与此模式匹配的所有文件或目录。

模式不区分大小写。*和? 通配符。使用|分隔多个模式。

更改后skip_file,您必须通过执行以下命令执行完全同步onedrive –resync

选择性同步

选择性同步允许您仅同步特定的文件和目录。要启用选择性同步,请创建一个名为sync_list中的文件~/.config/onedrive。文件的每一行代表您的相对路径sync_dir。在所有操作期间,将跳过与文件的任何行都不匹配的所有文件和目录。这是一个示例sync_list:

Backup

Documents/latest_report.docx

Work/ProjectX

notes.txt

共享文件夹

您可以通过Web界面将与您共享的文件夹添加到OneDrive中进行同步。转到共享文件列表,右键单击要同步的文件夹,然后单击“添加到我的OneDrive”。

所有命令

Usage: onedrive [OPTION]...

no option Sync and exit

--confdir Set the directory used to store the configuration files

-d --download Only download remote changes

--logout Logout the current user

-m --monitor Keep monitoring for local and remote changes

--print-token Print the access token, useful for debugging

--resync Forget the last saved state, perform a full sync

--syncdir Set the directory used to sync the files

-v --verbose Print more details, useful for debugging

--version Print the version and exit

-h --help This help information.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值