No description
  • D 95.5%
  • Shell 2.3%
  • Roff 0.9%
  • M4 0.7%
  • Makefile 0.4%
  • Other 0.2%
Find a file
abraunegg 70e3679536
Update safeRename() to retry on EINTR / EBUSY filesystem responses (#3587)
This change improves the robustness of safeRename() by adding bounded retry handling for transient filesystem errors and ensuring rename failures are handled safely and consistently.

**What changed**
* safeRename() now catches and handles std.file.rename() failures instead of allowing exceptions to propagate unexpectedly.
* The function retries rename operations when the underlying syscall returns:
    * EINTR — interrupted system call (signal delivery before completion)
    * EBUSY — temporary “resource busy” conditions
* Retries are capped and include a small backoff to avoid tight retry loops.
* EXDEV (cross-filesystem rename) is explicitly detected, logged, and not retried.
* Existing --dry-run behaviour is preserved.

**Why this is needed**
On POSIX systems (Linux and FreeBSD), rename() can legitimately fail with EINTR when a signal interrupts the syscall. Treating this as a hard failure leads to noisy logs and unnecessary operation aborts, particularly during shutdown, signal handling, or transient connectivity events.

In rarer cases, EBUSY may be returned due to temporary filesystem conditions. A limited retry avoids false failure reporting while still surfacing persistent or logical errors.

**Scope and behaviour**

* Applies to Linux and FreeBSD.
* No change to functional semantics for successful renames.
* Genuine error conditions (permissions, missing paths, cross-filesystem moves, etc.) are still logged and surfaced immediately.
* Aligns rename handling with the retry semantics recently added to safeRemove().

This brings safeRename() in line with POSIX-recommended handling for interruptible system calls while keeping retries bounded and safe.
2025-12-30 08:33:16 +11:00
.github Update safeRename() to retry on EINTR / EBUSY filesystem responses (#3587) 2025-12-30 08:33:16 +11:00
contrib Update Dockerfiles December 2025 (#3565) 2025-12-12 15:18:05 +11:00
docs Improve --resync warning prompt for clarity and safer operation (#3562) 2025-12-12 12:47:29 +11:00
src Update safeRename() to retry on EINTR / EBUSY filesystem responses (#3587) 2025-12-30 08:33:16 +11:00
tests Update makefiles.sh 2019-01-06 09:49:01 +11:00
.gitignore Ignoring files created during configure to be consistent with other files generated from .in templates (#3188) 2025-04-04 05:14:33 +11:00
aclocal.m4 autoconf based build system (#287) 2019-04-17 11:06:24 +10:00
changelog.md Release files for 2.5.9 (#3517) 2025-11-06 11:00:35 +11:00
config Fix Bug #3355: Fix that long running big upload (250GB+) fails because of an expired access token (#3361) 2025-07-03 17:21:16 +10:00
configure Release files for 2.5.9 (#3517) 2025-11-06 11:00:35 +11:00
configure.ac FreeBSD: Select inotify type (libc or linotify) based on FreeBSD version (#3579) 2025-12-24 08:01:14 +11:00
install-sh autoconf based build system (#287) 2019-04-17 11:06:24 +10:00
LICENSE OneDrive Client for Linux v2.5.0 (#2805) 2024-09-16 11:14:46 +10:00
Makefile.in Implement Desktop Manager Integration for GNOME and KDE (#3500) 2025-11-03 14:26:49 +11:00
onedrive.1.in Implement Desktop Manager Integration for GNOME and KDE (#3500) 2025-11-03 14:26:49 +11:00
readme.md Update readme.md (#3563) 2025-12-12 08:31:50 +11:00

OneDrive Client for Linux

Version Release Date Test Build Build Docker Images Docker Pulls

A fully featured, free, and actively maintained Microsoft OneDrive client that seamlessly supports OneDrive Personal, OneDrive for Business, Microsoft 365 (formerly Office 365), and SharePoint document libraries.

Designed for maximum flexibility and reliability, this powerful and highly configurable client works across all major Linux distributions and FreeBSD. It can also be deployed in containerised environments using Docker or Podman. Supporting both one-way and two-way synchronisation modes, the client provides secure and efficient file syncing with Microsoft OneDrive services — tailored to suit both desktop and server environments.

Project Background

This project originated as a fork of the skilion client in early 2018, after a number of proposed improvements and bug fixes — including Pull Requests #82 and #314 — were not merged and development activity of the skilion client had largely stalled. While its unclear whether the original developer was unavailable or had stepped away from the project - bug reports and feature requests remained unanswered for extended periods. In 2020, the original developer (skilion) confirmed they had no intention of maintaining or supporting their work (reference).

The original skilion repository was formally archived and made read-only on GitHub in December 2024. While still publicly accessible as a historical reference, an archived repository is no longer maintained, cannot accept contributions, and reflects a frozen snapshot of the codebase. The last code change to the skilion client was merged in November 2021; however, active development had slowed significantly well before then. As such, the skilion client should no longer be considered current or supported — particularly given the major API changes and evolving Microsoft OneDrive platform requirements since that time.

Under the terms of the GNU General Public License (GPL), forking and continuing development of open source software is fully permitted — provided that derivative works retain the same license. This client complies with the original GPLv3 licensing, ensuring the same freedoms granted by the original project remain intact.

Since forking in early 2018, this client has evolved into a clean re-imagining of the original codebase, resolving long-standing bugs and adding extensive new functionality to better support both personal and enterprise use cases to interact with Microsoft OneDrive from Linux and FreeBSD platforms.

Features

Broad Microsoft OneDrive Compatibility

  • Works with OneDrive Personal, OneDrive for Business, and Microsoft SharePoint Libraries.
  • Full support for shared folders and files across both Personal and Business accounts.
  • Supports single-tenant and multi-tenant Microsoft Entra ID environments.
  • Compatible with national cloud deployments:
    • Microsoft Cloud for US Government
    • Microsoft Cloud Germany
    • Azure/Office 365 operated by VNET in China

Flexible Synchronisation Modes

  • Bi-directional sync (default) - keeps local and remote data fully aligned.
  • Upload-only mode - only uploads local changes; does not download remote changes.
  • Download-only mode - only downloads remote changes; does not upload local changes.
  • Dry-run mode - test configuration changes safely without modifying files.
  • Safe conflict handling minimises data loss by creating local backups whenever this is determined to be the safest conflict-resolution strategy.

Client-Side Filtering & Granular Sync Control

  • Comprehensive rules-based client-side filtering (inclusions, exclusions, wildcard *, globbing **).
  • Filter specific files, folders, or patterns to tailor precisely what is synced with Microsoft OneDrive.
  • Efficient cached sync state for fast decision-making during large or complex sync sets.

Real-Time Monitoring & Online Change Detection

  • Near real-time processing of cloud-side changes using native WebSocket support.
  • Webhook support for environments where WebSockets are unsuitable (manual setup).
  • Real-time local change monitoring via inotify.

Data Safety, Recovery & Integrity Protection

  • Implements the FreeDesktop.org Trash specification, enabling recovery of items deleted locally due to online deletion.
  • Strong safeguards to prevent accidental remote deletion or overwrite after configuration changes.
  • Interruption-tolerant uploads and downloads, automatically resuming transfers.
  • Integrity validation for every file transferred.

Modern Authentication Support

  • Standard OAuth2 Native Client Authorisation Flow (default), supporting browser-based login, multi-factor authentication (MFA), and modern Microsoft account security requirements.
  • OAuth2 Device Authorisation Flow for Microsoft Entra ID accounts, ideal for headless systems, servers, and terminal-only environments.
  • Intune Single Sign-On (SSO) using the Microsoft Identity Device Broker (IDB) via D-Bus, enabling seamless enterprise authentication without manual credential entry.

Performance, Efficiency & Resource Management

  • Multi-threaded file transfers for significantly improved sync speeds.
  • Bandwidth rate limiting to control network consumption.
  • Highly efficient processing with state caching, reducing API traffic and improving performance.

Desktop Integration & User Experience

  • libnotify desktop notifications for sync events, warnings, and errors.
  • Registers the OneDrive folder as a sidebar location in supported file managers, complete with a distinctive icon.
  • Works seamlessly in GUI and headless/server environments. A GUI is only required for Intune SSO, notifications, and sidebar integration; all other features function without graphical support.

What's missing

  • Ability to encrypt/decrypt files on-the-fly when uploading/downloading files from OneDrive
  • Support for Windows 'On-Demand' functionality so file is only downloaded when accessed locally

External Enhancements

Frequently Asked Questions

Refer to Frequently Asked Questions

Have a question

If you have a question or need something clarified, please raise a new discussion post here

Supported Application Version

Support is only provided for the current application release version or newer 'master' branch versions.

The current release version is: Version

To check your version, run: onedrive --version. Ensure you are using the current release or compile the latest version from the master branch if needed.

If you are using an older version, you must upgrade to the current release or newer to receive support.

Basic Troubleshooting Steps

If you encounter any issues running the application, please follow these steps before raising a bug report:

  1. Check the application version
    Run onedrive --version to confirm which version you are using.

    • Ensure you are running the latest release.
    • If you are already on the latest release but still experiencing issues, manually build the client from the master branch to test against the very latest code. This includes fixes for bugs discovered since the last tagged release.
  2. Run in verbose mode
    Use the --verbose option to provide greater clarity and detailed logging about the issue you are facing.

  3. Test with IPv4 only
    Configure the application to use IPv4 network connectivity only, then retest. See the 'ip_protocol_version' option documentation for assistance.

  4. Test with HTTP/1.1 and IPv4
    Configure the application to use HTTP/1.1 over IPv4 only, then retest. See the 'force_http_11' option documentation for assistance.

  5. Verify cURL and libcurl versions
    If the above steps do not resolve your issue, upgrade both curl and libcurl to the latest versions provided by the curl developers.

  6. Open a new issue
    If the problem persists after completing the steps above, proceed to Reporting an Issue or Bug below and open a new issue with the requested details and logs.

Reporting an Issue or Bug

Important

Please ensure the problem is a software bug. For installation issues, distribution package/version questions, or dependency problems, start a Discussion instead of filing a bug report.

If you encounter a bug, you can report it on GitHub. Before opening a new issue report:

  1. Complete the Basic Troubleshooting Steps
    Confirm youve run through all steps in the section above.

  2. Search existing issues
    Check both Open and Closed issues for a similar problem to avoid duplicates.

  3. Use the issue template
    Open a new bug report using the issue template and fill in all fields. Complete detail helps us reproduce your environment and replicate the issue.

  4. Generate a debug log
    Follow this process to create a debug log.

    • If you are concerned about personal or business sensitive data in the debug log, you may:
      • Create a new OneDrive account, configure the client to use it, use dummy data to simulate your environment, and reproduce the issue; or
      • Provide an NDA or confidentiality agreement for signature prior to sharing sensitive logs.
  5. Share the debug log securely

    • Do not post debug logs publicly. Debug logs can include sensitive details (file paths, filenames, API endpoints, environment info, etc.).
    • Send the log via email to support@mynas.com.au using a trusted email account.
    • Archive and password-protect the log before sending (e.g. .zip with AES or .7z):
      • Example (zip with password): zip -e onedrive-debug.zip onedrive-debug.log
      • Example (7z with password): 7z a -p onedrive-debug.7z onedrive-debug.log
    • Send the password out-of-band (OOB) — not in the same email as the archive. Email support@mynas.com.au to arrange an OOB method (e.g. separate email thread, phone/SMS, or agreed channel).
    • If you require an NDA, attach your NDA or confidentiality agreement to your email. It will be reviewed and signed prior to exchanging sensitive data.

What to include in your bug report

When raising a new bug report, please include all details requested in the issue template, such as:

  • A clear description of the problem and how to reproduce it
  • Your operating system and installation method
  • OneDrive account type and client version
  • Application configuration and cURL version
  • Sync directory location, system mount points, and partition types
  • A full debug log, shared securely as described above

Providing complete information makes it much easier to understand, reproduce, and resolve your issue quickly.

Note

Submitting a bug report starts a collaboration. To help us help you, please:

  • Stay available to answer questions or provide clarifications if needed
  • Test and confirm fixes in your own environment when a pull request (PR) is created for your issue

Tip

Reports with missing details are much harder to investigate. Sharing as much as you can up front gives the best chance of a fast and accurate fix.

Known issues

Refer to docs/known-issues.md

Documentation and Configuration Assistance

Installing from Distribution Packages or Building the OneDrive Client for Linux from source

Refer to docs/install.md

Configuration and Usage

Refer to docs/usage.md

Configure OneDrive Business Shared Items

Refer to docs/business-shared-items.md

Configure SharePoint / Office 365 Shared Libraries (Business or Education)

Refer to docs/sharepoint-libraries.md

Configure National Cloud support

Refer to docs/national-cloud-deployments.md

Docker support

Refer to docs/docker.md

Podman support

Refer to docs/podman.md