How To Keep OneDrive In Sync With A Folder On Linux Using OneDrive Free Client Fork

OneDrive is a file hosting and synchronization service offered by Microsoft, similar to Dropbox, Google Drive, MEGA, and so on. There's no official Microsoft OneDrive client for Linux, but it's still possible to keep your OneDrive files in sync (with real-time file monitoring) with a folder on your Linux machine, and this article will show you how, by using a fork of OneDrive Free Client that's still maintained (a command line OneDrive client for Linux).

OneDrive Free Client for Linux (fork)

A while back I wrote about mounting OneDrive in Linux using Rclone (with both business and personal accounts support). Some users might prefer keeping their OneDrive files in sync with a folder on their Linux machine (having the files on the disk after the sync is performed, allowing access even when the computer is offline), only uploading / downloading the changes instead of mounting OneDrive, and in this article we'll do just that using a fork of OneDrive Free Client.

The original OneDrive Free Client was abandoned in the autumn of 2018, but the tool was forked a few months later under the same name, being under constant development since then.

The OneDrive Free Client fork is a complete tool to interact and sync OneDrive on Linux, featuring:

  • State caching
  • Real-Time file monitoring with Inotify
  • File upload / download validation to ensure data integrity
  • Resumable uploads
  • Support OneDrive for Business (part of Office 365)
  • Shared folders (OneDrive Personal)
  • SharePoint / Office 365 Shared Libraries
  • Desktop notifications via libnotify
  • Dry-run capability to test configuration changes
  • Prevent major OneDrive accidental data deletion after configuration change

Like the original project, the OneDrive Free Client fork doesn't have a graphical user interface so it must be used from the command line, though it does have desktop notifications that let you know about the sync status and any sync error that occurs.

It's also important to note that while local changes are uploaded right away to the linked Microsoft OneDrive account, remote changes are delayed until the next synchronization when using --monitor (this 'monitor' mode allows the OneDrive Free Client to continuously monitor your local file system for changes, and upload them when detected). E.g. when running this tool as a service, the OneDrive Free Client monitor interval is 45 seconds, so it may take up to 45 seconds for remote changes to be synchronized to your local drive.

As for shared folders, for OneDrive Personal accounts all you have to do is add them to your OneDrive. Do that by going to the OneDrive website and logging in to your account, then go to the Shared files list, right click on the folder you want to sync and then click Add to my OneDrive. For OneDrive Business or Office 365 accounts, shared folders are currently not supported.

0 Comments