Microsoft OneDrive Business/Office 365 Pro offers 1 TB of cloud storage but unfortunately there has never been a method to sync it on Linux.
Microsoft OneDrive Business/Office 365 Pro offers 1 TB of cloud storage but unfortunately there has never been a method to sync it on Linux.
Ubuntu 18.04 and later
UPDATE:
The below instructions to install from
apt
work, but the version inapt
is too out-of-date and fails to parse the authorization URI. Instead, following theINSTALL.md
doc to compile and install from source works:https://github.com/abraunegg/onedrive/blob/master/docs/INSTALL.md
PREVIOUS:
There is a OneDrive client in the default Ubuntu repositories in Ubuntu 18.04 and later. OneDrive is the cloud storage system of Microsoft. This package provides the command line client specializing in synchronizing with OneDrive cloud storage.
Install it with:
At first run, it asks you to authenticate with a link. After authentication you can enable the deamon with
systemctl --user enable onedrive
and thensystemctl --user start onedrive
.It will monitor and sync OneDrive data locally in
~/OneDrive
. Further explanations can be found in the manpageman onedrive
. It's very easy to setup, and only takes about five minutes.Currently the experimental onedrive-d is an open-source program that can sync only personal OneDrive accounts as it does not accept Microsoft Sharepoint links. Here is a method to sync OneDrive Business/Office 365 using GoodSync for Linux, which is free for personal use.
Install suitable version to your Linux machine eg:
Answer by no for both GoodSync Connect setup and GsServer Web UI.
https://xxxxxxx.sharepoint.com/xxxxxxxxxxx/Documents/Forms/All.aspx
and based on it get your syncing link which will beoffice365://xxxxxxx.sharepoint.com/xxxxxxxxxxx/Documents
.Create a new file in .goodsync subfolder in your home:
Enter the following code in the file and save it:
Start the syncing process:
At this step your web Browser will open OneDrive/Office 365 page and ask for your authorization to allow goodsync to access your account. After entering your credentials syncing will start.
Limitations: Microsoft does not allow URL Requests with length of more than 270 character and so GoodSync CAN NOT sync files with long pathnames.
Enjoy!
rclone supports OneDrive for Business. See an article How To Mount OneDrive In Linux Using Rclone (Supports Business And Personal Accounts) - Linux Uprising Blog for usage.
Here is my example to setup a new remote
onedrive1
with rclone 1.48.0 (on Fedora 30):The drive 0's URL ends with
/ElementinnerHTML
and doesn't contain files in my case.Then mount it on a local directory via command line, rclone-browser or web GUI since v1.49.
While the original and commonly used
onedrived
tool by xybu still does not support OneDrive for Business, but only personal OneDrives. however, there is a fork of this project on GitHub by derrix060 that has a somehow working (but still buggy) implementation for the Business client.See the project's readme file for complete installation instructions, but here's a short summary:
Installation
Make sure you have no other version of
onedrived
(oronedrive-d
) installed.Install dependency packages:
Download the latest
ngrok
client for Linux from the official website at https://ngrok.com/download. Thengrok-client
package from the Ubuntu repositories is too old and doesn't meet the requirements.Unpack the downloaded
ngrok-stable-linux-amd64.zip
archive. It contains a singlengrok
binary, which you should put in a location on your$PATH
, e.g. into/usr/local/bin/
.Signing up to ngrok is probably not necessary.
Install the
onedrived
Python3 application from GitHub usingpip3
:Optionally configure a logfile location for
onedrived
, where you can check for problems if anything should not work correctly, e.g.:Account setup and drive configuration
After the installation was successful, you have to configure your account and drive(s):
Add your OneDrive for Business account using the interactive mode by running:
The interactive wizard will ask you twice to open a link in your browser, where you will have to authorize the application with your Microsoft Business account.
It will ask you to paste the URL you get redirected to after confirming the authorization back into the interactive wizard. Please do as told and follow the instruction the command gives you.
Verify the account got added successfully by checking the output of the command below. It should look similar and list the account you are logged in with:
Configure your drives in the interactive command mode by running:
You will see a list of all your drives and get asked to enter the row number of the drive you want to add to your local configuration.
You then have to specify a local directory that you want to use as root folder for synchronizing with your drive. You can just hit Enter and it will use the default
~/OneDrive
. If the path does not exist, it will be created. Same thing for the path to the ignore file you want to use, you can just hit Enter and it will use the default~/.config/onedrived/ignore_v2.txt
and create it, if necessary.Check the output of the command below to display the information about all available and configured drives. It should show the drive you just set up with the correct settings under the headline
Drives that have been set up
:Launching the daemon
Now that your drive is configured, you need to try and start the
onedrived
daemon. I recommend to launch it in debug mode first, in case there are any problems you would otherwise miss. This will startonedrived
in foreground:If everything is okay and the command does not crash and exit, try putting some files on your local OneDrive folder and see if it synchronizes. You should probably be able to verify that by visiting the OneDrive web application at https://www.office.com and checking if the files you added locally are appearing there.
You can quit the
onedrived
process in your terminal again by pressing Ctrl+C.To launch
onedrived
normally, as a background daemon, run it with:You should probably add this command to your Startup Applications, so that it auto-starts every time you log in. Please refer to How do I start applications automatically on login? for that.
Wrapper for error notifications
If you want to get desktop notifications whenever
onedrived
logs an error (e.g. failed file synchronization), here is a wrapper script that parses the log file in real-time and uses notify-send to display them to you.You can start the wrapper script without arguments (or put it in your auto-start applications) instead of the
onedrived start
command.