Linux安装第三方Microsoft OneDrive —— abraunegg / onedrive

注意:以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

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值