Free Client for OneDrive on Linux
sudo apt install libcurl4-openssl-dev sudo apt install libsqlite3-dev
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
sudo yum install libcurl-devel sudo yum install sqlite-devel curl -fsS https://dlang.org/install.sh | bash -s dmd
sudo pacman -S curl sqlite dlang
git clone https://github.com/skilion/onedrive.git cd onedrive make sudo make install
sh make DC=ldmd2
After installing the application you must run it once from an interactive terminal to authorize it.
You will be asked to open a specific link using your web browser where you will have to login into your Microsoft Account and give the application the permission to access your files. After giving the permission, you will be redirected to a blank page. Copy the URI of the blank page into the application.
sudo make uninstall # delete the application state from your home directory rm -rf ~/.config/onedrive
Configuration is optional. By default all files are downloaded in
~/OneDriveand only hidden files are skipped. If you want to change the defaults, you can copy and edit the included config file into your
~/.config/onedrivedirectory and edit it:
sh mkdir -p ~/.config/onedrive cp ./config ~/.config/onedrive/config nano ~/.config/onedrive/config
Available options: *
sync_dir: directory where the files will be synced *
skip_file: any files or directories that match this pattern will be skipped during sync.
Patterns are case insensitive.
?wildcards characters are supported. Use
|to separate multiple patterns.
Note: after changing
skip_file, you must perform a full synchronization by executing
Selective sync allows you to sync only specific files and directories. To enable selective sync create a file named
~/.config/onedrive. Each line of the file represents a relative path from your
sync_dir. All files and directories not matching any line of the file will be skipped during all operations. Here is an example of
text Backup Documents/latest_report.docx Work/ProjectX notes.txtNote: after changing the sync list, you must perform a full synchronization by executing
Folders shared with you can be synced by adding them to your OneDrive through the web interface. Go to the Shared files list, right click on the folder you want to sync and then click on "Add to my OneDrive".
If you want to sync your files automatically, enable and start the systemd service:
sh systemctl --user enable onedrive systemctl --user start onedrive
To see the logs run:
sh journalctl --user-unit onedrive -f
Note: systemd is supported on Ubuntu 15.04 onward
You can run multiple instances of the application specifying a different config directory in order to handle multiple OneDrive accounts. To do this you can use the
sh onedrive --monitor --confdir="~/.config/onedrivePersonal" & onedrive --monitor --confdir="~/.config/onedriveWork" &
--monitorkeeps the application running and monitoring for changes
&puts the application in background and leaves the terminal interactive
If you encounter any bugs you can report them here on Github. Before filing an issue be sure to:
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.
The files and directories in the synchronization directory must follow the Windows naming conventions. The application will crash for example if you have two files with the same name but different case. This is expected behavior and won't be fixed.