Sometimes lately it can be necessary to use propriety products. Open source enthusiasts would love to have a cloud-based storage facility, but the fact remains that companies like Google, Amazon, Dropbox and Microsoft have cornered the cloud storage market. They offer reliable products for free, and this mean that yes, they will scan or read your files in order to comply with legal requests or to serve adverts. It is a fact of life, but this doesn’t mean you shouldn’t use them.
OneDrive is Microsoft’s cloud based storage offering, and even though it is naturally suited to the Windows platform, it will connect with Linux-based machines with little effort. There are a number of ways to do this, and this is where OneDrive-d comes into play.
OneDrive-d: Odd name, great client
OneDrive-d is a CLI-based client developed by Xiangyu Bu. It lets users sync quickly and easily with OneDrive (much in the same vein as RSync does).
In order to install OneDrive-d, first you need to set up git, unless you already have it. Head to the Terminal and enter:
Next, you need to clone the OneDrive-d files to the hidden folder:
You will then need to run the installer:
Once this is done, we need
ngrok. Despite the name, this isn’t the next Marvel franchise. ngrok is a third-party platform for relaying webhook integration. OneDrive-d uses ngrok to allow webhook requests from the OneDrive API to bypass port-forwarding and the like.
Grab a copy of ngrok and extract. Now copy it to your directory:
After you have done this, now you need to authorize OneDrive-d with Microsoft so it can access your account. Simply enter the following in the Terminal:
This launches the interactive wizard that will let you configure the program. You need to copy the URL into your browser to complete the authentication. Once this is done, you will be presented with a blank white page. This serves to give you the new URL you need. Copy this and paste it into the Terminal at the prompt.
Next, you need to set the drive to be used with the following command:
This runs through some interactive settings – follow the prompts, and finish up the configuration. To make it easier, leave the default path as is, and press Y to sync that folder. Start OneDrive-d by typing:
You should start to see your files sync locally. If you store large files, as I do, it will take some time, so please be patient. You can check on the progress by navigating to Home – OneDrive within your file manager.
Bonus: Starting OneDrive-d at login
By default, OneDrive-d doesnt start when the user logs in for the first time. The daemon is essentially dumb unless we change that. Head to the Terminal once more and tell the system that you want GNOME to start on login with:
This will open the GNOME session configuration where you can add OneDrive-d as a startup program. The command is:
Now your OneDrive will sync with your Linux system. However, how do you sync OneDrive to your setup, and do you prefer other tools? Let us know in the comments section below.
Image credit: Microsoft OneDrive website under a magnifying glass by DepositPhotos