注意:以Ubuntu20.04为例,选取的三方Microsoft To-Do软件为abraunegg / onedrive
-
安装:建议推荐直接看官方教程。为了方便,我把Ubuntu 20.04的搬过来了,其他发行版需要自己去官方教程里面找
wget -qO - https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/Release.key | sudo apt-key add - echo 'deb https://download.opensuse.org/repositories/home:/npreining:/debian-ubuntu-onedrive/xUbuntu_20.04/ ./' | sudo tee /etc/apt/sources.list.d/onedrive.list sudo apt-get update sudo apt install onedrive
PS:如果官方教程中有这样一个Note,则需要注意不要从apt镜像源上直接安装(因为被弃用了),需要根据官方教程来(即红色方框下面的Instructions)
-
登录账号:终端运行命令
onedrive
,将终端中显示的网址复制粘贴到浏览器中,然后登录微软账号,登录成功后将最后的网址复制粘贴到终端中,显示成功即可 -
设置配置文件:将仓库中的config文件下载到路径
~/.config/onedrive
中- 文件同步路径可以修改config文件中的sync_dir参数
- 更新间隔时间可以修改config文件中的monitor_interval参数
-
同步一遍:确认账号啥的没有问题
onedrive --synchronize
-
设置开机自启:详细见官方文档
- 普通用户
systemctl --user enable onedrive systemctl --user start onedrive # 查看日志 journalctl --user-unit=onedrive -f
- root用户
systemctl enable onedrive systemctl start onedrive # 查看日志 journalctl --unit=onedrive -f
-
开启自动同步:
onedrive --monitor
PS:如果报错
Too Many Open files error
,大概率是因为OneDrive中的文件数量太多,超过系统文件句柄数。需要在文件/etc/security/limits.conf
的末尾(# End of file之前)添加如下内容,然后重启* soft nofile 65535 * hard nofile 65535
参考教程:
【Linux】Linux下使用Onedrive自动同步文件,deepin系统使用abraunegg/onedrive