如何在 Linux 上同步 OneDrive Business /Office 365?

Say*_*aly 44 sync cloud microsoft office365

Microsoft OneDrive Business/Office 365 Pro 提供 1 TB 的云存储空间,但不幸的是,从来没有一种方法可以在 Linux 上同步它。

Mat*_*_98 27

Ubuntu 18.04 及更高版本

更新:

以下说明从apt工作中安装,但版本apt太过时并且无法解析授权 URI。相反,按照INSTALL.md文档从源代码进行编译和安装是可行的:

https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md

以前的:

Ubuntu 18.04 及更高版本的默认 Ubuntu 存储库中有一个OneDrive 客户端。OneDrive 是微软的云存储系统。此包提供专门用于与 OneDrive 云存储同步的命令行客户端。

安装它:

sudo apt install onedrive
Run Code Online (Sandbox Code Playgroud)

第一次运行时,它会要求您使用链接进行身份验证。身份验证后,您可以使用systemctl --user enable onedrive和启用守护进程systemctl --user start onedrive

它将在本地监视和同步 OneDrive 数据~/OneDrive。进一步的解释可以在联机帮助页中找到man onedrive。设置非常简单,只需要大约五分钟。

  • 这不适用于 OneDrive for Business (7认同)
  • @tricasse 适用于 Office 365 Pro (2认同)
  • 实际上我的授权失败了。因此,我按照 https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md 中的说明最终解决了问题。目前一切正常。 (2认同)

Say*_*aly 9

目前实验性的 onedrive-d 是一个开源程序,它只能同步个人 OneDrive 帐户,因为它不接受 Microsoft Sharepoint 链接。这是一种使用GoodSync for Linux同步 OneDrive Business/Office 365 的方法,该方法可供个人免费使用。

  1. 为您的 Linux 机器安装合适的版本,例如:

    ./goodsync-linux-x86_64-release.run
    
    Run Code Online (Sandbox Code Playgroud)

    对于 GoodSync Connect 设置和 GsServer Web UI,请回答n o。

  2. 在 Web 浏览器中打开 OneDrive。选择右下侧的“返回到经典 OneDrive”。
  3. 您浏览器中的网址现在将如下所示: https://xxxxxxx.sharepoint.com/xxxxxxxxxxx/Documents/Forms/All.aspx并基于它获取您的同步链接,该链接将是office365://xxxxxxx.sharepoint.com/xxxxxxxxxxx/Documents.
  4. 在您家中的 .goodsync 子文件夹中创建一个新文件:

    gedit ~/.goodsync/jobs.tix
    
    Run Code Online (Sandbox Code Playgroud)
  5. 在文件中输入以下代码并保存:

    <Job>
    Name = "OneDrive_Sync"
    Side1 = <SideOptions>
    Dir = <Connect>
        Url = "put_your_syncing_link_here"
        UserID = "put_your_OneDrive/Office365_Bussiness_email_here"
    </Connect>
    </SideOptions>
    Side2 = <SideOptions>
    Dir = <Connect>
        Url = "file:///your_home_folder/one_drive_folder"
    </Connect>
    </SideOptions>
    Direction = 0
    ExcludeHidden = No
    ExcludeSystem = No
    DetectMovesAndRenames = Yes
    LinksOption = 1
    ExcludeEmptyFolders = No
    LimitChangesPercent = 100
    AutoResolveConflicts = 3
    DetectMovesAndRenames = Yes
    </Job>
    
    Run Code Online (Sandbox Code Playgroud)
  6. 开始同步过程:

    gsync sync "OneDrive_Sync"
    
    Run Code Online (Sandbox Code Playgroud)
  7. 在这一步,您的 Web 浏览器将打开 OneDrive/Office 365 页面并要求您授权以允许 goodsync 访问您的帐户。输入您的凭据后,同步将开始。

限制:Microsoft 不允许长度超过 270 个字符的 URL 请求,因此 GoodSync 无法同步具有长路径名的文件。

享受!

  • 我的网络浏览器在第 7 步没有打开授权页面。知道如何手动完成吗? (3认同)
  • 我的网络浏览器也无法打开登录 (3认同)
  • office365:/.../Documents 中的文件系统已被 New OneDrive V2 API 取代。单击浏览按钮重新浏览到您的 OneDrive 同步文件夹,因为新 OneDrive 需要基于浏览器的身份验证 (OAuth2) (2认同)

小智 5

rclone支持 OneDrive for Business。\n请参阅文章如何使用 Rclone 在 Linux 中挂载 OneDrive(支持企业和个人帐户)- Linux Uprising 博客以了解使用方法。

\n\n

onedrive1这是我使用 rclone 1.48.0设置新远程的示例(在 Fedora 30 上):

\n\n
$ rclone config\n2019/10/10 06:35:56 NOTICE: Config file ".config/rclone/rclone.conf" not found - using defaults\nNo remotes found - make a new one\nn) New remote\ns) Set configuration password\nq) Quit config\nn/s/q> n\nname> onedrive1\nType of storage to configure.\nEnter a string value. Press Enter for the default ("").\nChoose a number from below, or type in your own value\n\xe2\x8b\xae\n19 / Microsoft OneDrive\n   \\ "onedrive"\n\xe2\x8b\xae\nStorage> 19      \n** See help for onedrive backend at: https://rclone.org/onedrive/ **\n\nMicrosoft App Client Id\nLeave blank normally.\nEnter a string value. Press Enter for the default ("").\nclient_id> \nMicrosoft App Client Secret\nLeave blank normally.\nEnter a string value. Press Enter for the default ("").\nclient_secret> \nEdit advanced config? (y/n)\ny) Yes\nn) No\ny/n> n\n\nRemote config\nUse auto config?\n * Say Y if not sure\n * Say N if you are working on a remote or headless machine\ny) Yes\nn) No\ny/n> y\nIf your browser doesn\'t open automatically go to the following link: http://127.0.0.1:53682/auth\nLog in and authorize rclone for access\nWaiting for code...\nGot code\nChoose a number from below, or type in an existing value\n 1 / OneDrive Personal or Business\n   \\ "onedrive"\n 2 / Root Sharepoint site\n   \\ "sharepoint"\n 3 / Type in driveID\n   \\ "driveid"\n 4 / Type in SiteID\n   \\ "siteid"\n 5 / Search a Sharepoint site\n   \\ "search"\nYour choice> 1\nFound 2 drives, please select the one you want to use:\n0: OneDrive - Example Inc (business) id=b!gFLg-RRe****-T9B****\n1: OneDrive - Example Inc (business) id=b!gFLg-RRe****-T-H****\nChose drive to use:> 1\nFound drive \'root\' of type \'business\', URL: https://example-my.sharepoint.com/personal/myname_example_com/Documents\nIs that okay?\ny) Yes\nn) No\ny/n> y\nCurrent remotes:\n\nName                 Type\n====                 ====\nonedrive1            onedrive\n\ne) Edit existing remote\nn) New remote\nd) Delete remote\nr) Rename remote\nc) Copy remote\ns) Set configuration password\nq) Quit config\ne/n/d/r/c/s/q> q\n
Run Code Online (Sandbox Code Playgroud)\n\n

在我的例子中,驱动器 0 的 URL 以 结尾/ElementinnerHTML并且不包含文件。

\n\n

然后从 v1.49 开始通过命令行、 rclone-browserWeb GUI将其挂载到本地目录。

\n