OneDrive client alternative
Synchronize OneDrive with rclone
- Install and configure rclone. You can follow my previous guide if you haven't already.
-
To make your local folder an exact mirror of your OneDrive folder (download only), use:
<path_to_rclone>\rclone.exe sync "<rclone_name>:<remote_folder>" "<local_folder>" -P -vExample:
C:\rclone\rclone.exe sync "my_onedrive:My Documents" "C:\Users\default\Documents" -P -vWhat this command does
syncmakes the destination (local folder) exactly match the source (OneDrive).- Downloads new files from OneDrive.
- Updates files that have changed on OneDrive.
- Deletes local files that were deleted from OneDrive.
- Nothing is uploaded to OneDrive.
-
To create a one-way mirror from your local folder to OneDrive, reverse the source and destination:
<path_to_rclone>\rclone.exe sync "<local_folder>" "<rclone_name>:<remote_folder>" -P -vExample:
C:\rclone\rclone.exe sync "C:\Users\default\Documents" "my_onedrive:My Documents" -P -vWhat this command does
- Your local folder becomes the source.
- OneDrive becomes the destination.
- New and updated local files are uploaded.
- Files deleted locally are also deleted from OneDrive.
- The OneDrive folder becomes an exact mirror of your local folder.
Important: If the official OneDrive sync client is already synchronizing the same local folder to the same OneDrive account, don't run both at the same time. They can interfere with each other because both are trying to synchronize the same files.
If you use rclone as your synchronization method, pause or stop the OneDrive client for that account before running rclone sync.
Avoiding the OneDrive 250,000 File Limit
Using rclone instead of the official OneDrive client is an effective way to avoid the approximately 250,000-item limit recommended by Microsoft.
Why?
-
Official OneDrive client
- Maintains a local synchronization database.
- Microsoft recommends staying below roughly 250,000 synced items (files and folders combined).
- Very large libraries can become slow, consume more RAM and CPU, or experience synchronization problems.
-
rclone
- Does not maintain a permanent synchronization database.
- Each time you run
sync, it compares the source and destination, performs the required changes, then exits. - There is no practical built-in 250,000-item limit. rclone can handle much larger libraries, although synchronization naturally takes longer as the number of files increases.
Things to keep in mind
- The first synchronization may take a long time.
- Every subsequent
syncstill scans both the source and destination, so very large libraries require time even when only a few files have changed. - Use the
-Poption to display progress. - If you schedule the synchronization (for example, hourly or nightly), later runs are usually much faster because only changed files are transferred.
Replacing the OneDrive client with rclone is a common solution for users with very large libraries. It also gives you complete control over the synchronization direction instead of relying on a continuously running two-way sync client.
Detecting When OneDrive Storage Is Full
The official OneDrive client displays notifications when your storage is almost full. With rclone, you'll usually discover this only when an upload fails.
Here are several ways to monitor available storage.
1. Check the Exit Code (Recommended for Scheduled Tasks)
- rclone returns a non-zero exit code if the synchronization fails.
- Your batch file or scheduled task can detect the failure and display a message, write a log entry, or send an email notification.
2. Keep a Log File
Write all output to a log file:
rclone sync ... -P -v --log-file="E:\Logs\rclone.log"
If OneDrive is full, the log typically contains an error such as insufficient quota.
3. Check Available Storage Before Synchronizing
Run:
rclone about my_onedrive:
Typical output:
Total: 1024 GiB
Used: 812 GiB
Free: 212 GiB
Trashed: ...
This lets you verify the remaining storage before starting a large synchronization.
4. Automate Low-Space Warnings
You can create a small Batch or PowerShell script that:
- Runs
rclone about. - Checks the available free space.
- Warns you (or exits) if free space falls below a threshold such as 20 GB.
- Starts
rclone synconly when sufficient storage is available.
Using Files On-Demand with rclone
The official OneDrive client provides Files On-Demand (also called Available online only). This Windows feature uses the Cloud Files API (CFAPI) to create placeholder files that appear in File Explorer but are not downloaded until you open them.
In contrast, rclone sync copies the actual files to your local drive. Every synchronized file occupies disk space.
If You Want On-Demand Access
The recommended solution is to use WinFsp together with rclone mount.
rclone mount my_onedrive: O: ^
--vfs-cache-mode full ^
--cache-dir C:\rclone-cache ^
--vfs-cache-max-age 24h ^
--dir-cache-time 24h ^
--poll-interval 0 ^
--file-perms 0777
This creates an O: drive that streams files from OneDrive as you access them.
You can further control cache behavior with options such as:
--vfs-cache-mode full
--cache-dir C:\rclone-cache
--vfs-cache-max-age 168h
--vfs-cache-max-size 500G
For example:
--vfs-cache-max-age 168hkeeps cached files for 7 days after they were last accessed.--vfs-cache-max-size 500Glimits the cache to 500 GB. When the limit is reached, the least recently used cached files are removed automatically.
If you have a 5 TB OneDrive account but set a 500 GB cache, only files you've actually accessed are stored locally. Older cached files are automatically removed as needed.
Most Commonly Used rclone mount Options
| Option | Typical Value | Description |
|---|---|---|
--vfs-cache-mode |
full |
Caches opened files locally so Windows applications work correctly. |
--cache-dir |
C:\rclone-cache |
Location where cached files are stored. |
--vfs-cache-max-age |
24h or 168h |
Automatically removes cached files that haven't been accessed within the specified time. |
--vfs-cache-max-size |
100G, 500G, or unlimited |
Maximum cache size before older cached files are removed. |
--dir-cache-time |
24h or 72h |
How long directory listings are cached. |
--poll-interval |
1m, 5m, or 0 |
How often rclone checks OneDrive for changes. Setting 0 disables polling. |
--read-only |
Optional | Prevents uploads, modifications, and deletions. |
--network-mode |
Rarely used | Mounts the drive as a Windows network drive instead of a local drive. |
--volname |
"OneDrive" |
Sets the friendly drive name shown in File Explorer. |
--links |
Rarely used | Stores symbolic links as .rclonelink files. |
--daemon |
Linux/macOS only | Runs rclone in the background. Not supported on Windows. |
--allow-other |
Linux only | Allows other users on the system to access the mounted drive. |
--attr-timeout |
Leave default | Controls how long file attributes are cached. |
--buffer-size |
32M or 64M |
Read-ahead buffer used when streaming files. Larger values improve streaming but use more RAM. |
--vfs-read-ahead |
64M or 128M |
Reads data ahead while streaming large files, improving video playback. |
--drive-pacer-min-sleep |
Leave default | Applies only to Google Drive and is not relevant for OneDrive. |
--tpslimit |
5 to 10 |
Limits API requests per second to reduce the chance of Microsoft throttling. |
Options You Probably Don't Need
Most users can safely ignore these options unless they have a specific use case:
--network-mode--read-only--links--allow-other--daemon(Windows doesn't support it)--attr-timeout
Nice-to-Have Options
These options aren't essential, but they can improve the overall experience.
Better Streaming Performance
--buffer-size 64M
--vfs-read-ahead 128M
Recommended if you regularly watch large videos directly from the mounted drive.
Friendlier Drive Name
--volname "My OneDrive"
Instead of displaying:
Local Disk (O:)
Windows Explorer will display:
My OneDrive (O:)
Reduce Microsoft API Throttling
If you mount multiple OneDrive accounts simultaneously, limiting API requests can help avoid throttling.
--tpslimit 8
This slightly reduces request rates while keeping the mounted drives responsive.
OneDrive Files On-Demand vs. rclone mount
| Feature | OneDrive Files On-Demand | rclone mount |
|---|---|---|
| Download files on demand | ✅ | ✅ |
| Cache downloaded files | ✅ | ✅ |
| Automatically remove old cached files | Sometimes (Storage Sense) | ✅ Configurable |
| Offline access to cached files | ✅ | ✅ While cached |
| Placeholder files in File Explorer | ✅ | ❌ |
| Configurable cache location | ❌ | ✅ |
Running Multiple rclone Mounts with VBScript
If you use WinFsp together with rclone mount, you can start your mounts automatically using a VBScript.
A single VBScript can launch multiple rclone mount processes, each using a different drive letter.
Example:
Set WshShell = CreateObject("WScript.Shell")
opts = " --vfs-cache-mode full --cache-dir C:\rclone-cache --vfs-cache-max-age 24h --dir-cache-time 24h --poll-interval 0 --file-perms 0777"
WshShell.Run """C:\rclone\rclone.exe"" mount my_onedrive:remote_folder O:" & opts, 0, False
WshShell.Run """C:\rclone\rclone.exe"" mount my_onedrive2: P:" & opts, 0, False
WshShell.Run """C:\rclone\rclone.exe"" mount my_onedrive3: Q:" & opts, 0, False
Each mount:
- Runs in the background.
- Does not display a Command Prompt window.
- Uses its own drive letter (
O:,P:,Q:, etc.).
This approach is ideal if you want Windows to mount multiple OneDrive accounts with a single script.
Stopping a Specific Mount
If you have multiple rclone mount processes running, you don't have to close all of them. Instead, locate the process ID (PID) of the mount you want to stop.
In PowerShell, run:
Get-CimInstance Win32_Process |
Where-Object {
$_.Name -eq "rclone.exe" -and $_.CommandLine -like "*mount*"
} |
Select-Object ProcessId, CommandLine
The output will list every running rclone mount process together with its command line and process ID.
To stop a specific mount, use its PID:
Stop-Process -Id <PID>
For example:
Stop-Process -Id 12345
This stops only the selected mount, leaving any other rclone mount processes running.
Conclusion
Using rclone is an excellent alternative to the official OneDrive client, especially for users with very large file collections or those who prefer one-way synchronization.
With rclone sync, you have complete control over the synchronization direction and can avoid the performance limitations of the OneDrive client.
If you prefer on-demand file access similar to OneDrive's Files On-Demand, combining WinFsp with rclone mount provides a lightweight and highly configurable solution.
Whether you need scheduled backups, one-way synchronization, or multiple mounted OneDrive accounts, rclone offers a flexible and powerful toolset that is well worth learning.
Comments
Post a Comment