How to sync Microsoft OneDrive with Linux
Open source enthusiasts love to have a cloud-based storage device. Companies like Google, Amazon, Dropbox and Microsoft offer reliable products for free. This means that these companies will scan or read user files to comply with legal requirements or to serve ads. That is the reality of life, but this does not mean that users should not use these cloud storage services.
OneDrive is Microsoft's cloud-based storage service. Although it fits perfectly with the Windows platform, OneDrive will also connect to machines running on the Linux platform very easily. There are several ways to do this. Let's learn how to synchronize Microsoft OneDrive with Linux through the following article!
Instructions for syncing Microsoft OneDrive with Linux
- Install Onedrive
- For Ubuntu
- For Fedora
- For Arch Linux
- Setting
- Configuration
- Selective synchronization
- Start Onedrive when logging in
Install Onedrive
Onedrive is a CLI-based client, allowing users to sync quickly and easily with OneDrive.
To install Onedrive, first install some dependencies and set up git. Go to Terminal and enter one of the following commands.
For Ubuntu
sudo apt install libcurl4-openssl-dev git sudo apt install libsqlite3-dev
If you are using Ubuntu 18.04 and above, use snap to install dmd:
sudo snap install --classic dmd && sudo snap install --classic dub
If not, use the following command:
sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list sudo apt-get update && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring sudo apt-get update && sudo apt-get install dmd-compiler dub
For Fedora
sudo yum install libcurl-devel git sudo yum install sqlite-devel curl -fsS https://dlang.org/install.sh | bash -s dmd
For Arch Linux
sudo pacman -S curl sqlite dlang git
Setting
After installing dependencies, fetch files with git:
git clone https://github.com/skilion/onedrive.git
Compile and install it:
cd onedrive make sudo make install
After doing this, users now need to authorize Onedrive with Microsoft so that it can access the account. Just enter the following information in Terminal:
onedrive
And the user will be prompted to access the URL to receive authorization.
Log in to your OneDrive account and authorize the application to access your account.
Once this is done, an empty white page will appear. Copy the URL and paste it into Terminal at the command prompt.
Onedrive will start downloading all files in the cloud to the local directory.
Configuration
Users can find the 'config' file in the 'onedrive git' folder . To enable it, move it to the '~ / .config / onedrive /' directory.
mkdir -p ~/.config/onedrive cp ~/onedrive/config ~/ .config/onedrive/config
Open the file 'config'. There are two configuration options: 'sync_dir' and 'skip_files'.
- sync_dir: The location for storing OneDrive files. All files placed in or deleted from this folder will be synchronized with the cloud.
- skip_files: File type (or file template) is not synchronized.
After making the changes, save and restart Onedrive.
Selective synchronization
If you prefer to use the selective sync feature rather than synchronizing the entire OneDrive folder, users can create a file named 'sync_list' and place it in the '~ / .config / onedrive' folder. Inside the file add the relative path (from the synchronized OneDrive folder) to the files or folders you want to sync.
Start Onedrive when logging in
By default, Onedrive does not start when users log on. To make it automatically run when logged in, users can use systemd:
sudo systemctl --user enable onedrive sudo systemctl --user start onedrive
Or just add Onedrive to the startup application.
Now OneDrive will sync with the Linux system.
Hope you are succesful.
You should read it
- How to fix the problem of syncing OneDrive on Windows 10
- OneDrive launches file protection for Windows 10 users
- 8 super useful things you can do with Microsoft OneDrive on Android
- Create referral links in OneDrive to increase storage space
- Microsoft is starting to push the rollout of a 64-bit version of OneDrive to Windows 10 users
- How to reinstall Microsoft OneDrive on Windows 10
- How to transfer archived data from OneDrive to another drive
- How to double OneDrive's free storage
- Instructions for using OneDrive on iOS devices
- Microsoft closes the time to declare from the OneDrive desktop app on Windows 7, 8 and 8.1
- Sync Desktop, Document, ... on Windows 10 with OneDrive
- Tips to help you use the OneDrive online storage service better