Using Rclone to pull down OneDrive, Google Drive or Dropbox contents to local Linux machine.
After realizing that I did not have a reliable, easy, and secure way to copy my OneDrive, Google Drive or Dropbox contents to my local machine, I set up Rclone for this job after reviewing the options. This post shows how I did that, but be mindful that this is not a ‘generic’ setup as it is specific to my current workflows.
POST INSTALLATION AND ONGOING PROCEDURE UPDATE:
After you do this initially, what you want to do is run Rclone in the dry run mode to see if there’s anything that needs to be updated, and then you just run the same command without the dry run flag.
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive --dry-run -P --update --exclude "Personal Vault/**"
After reviewing that output, run:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive --update --exclude "Personal Vault/**"
Rclone Setup for OneDrive on Linux
Overview
This guide documents the complete setup process for using rclone to access Microsoft OneDrive from Linux Mint. Rclone is a command-line tool that syncs files and directories to and from cloud storage services using their native APIs.
Important: Customize for Your System
This guide was created for a specific setup. You will need to adjust these paths for your own system:
- Username: Replace
/home/mark/with/home/YOUR_USERNAME/ - External drive: Replace
/media/mark/Ext_T7_lpthp/with your own drive mount point- Find yours with:
lsblkor check/media/YOUR_USERNAME/
- Find yours with:
- Remote name: “OneDrive” is used throughout - you can use any name you want
- Drive selection: When configuring, your OneDrive options may be numbered differently
The core process (install → configure → authenticate → copy) is universal and works for everyone.
Initial Installation
1
sudo apt install rclone
Configuration Process
Step 1: Start Configuration
1
rclone config
You’ll see:
1
2
3
4
5
No remotes found, make a new one?
n) New remote
s) Set configuration password
q) Quit config
n/s/q>
Choose: n (New remote)
Step 2: Name Your Remote
1
name> onedrive
You can use any name you want - this is just the label rclone will use in commands.
Step 3: Select Storage Type
From the numbered list of storage providers, choose:
1
Storage> 30
(Option 30 is “Microsoft OneDrive”)
Step 4: OAuth Client Settings
1
2
client_id> [press Enter - leave blank]
client_secret> [press Enter - leave blank]
You don’t need custom OAuth credentials for personal OneDrive access.
Step 5: Choose Region
1
region> [press Enter for default "global"]
Unless you’re using a government or special regional OneDrive account, use the default global option.
Step 6: Advanced Config
1
2
Edit advanced config?
y/n> n
No advanced configuration needed for basic usage.
Step 7: Auto Configuration
1
2
Use auto config?
y/n> y
This will open a browser window for Microsoft authentication. Log in with your Microsoft account and authorize rclone.
Step 8: Select Drive Type
1
config_type> [press Enter for default "onedrive"]
Choose “OneDrive Personal or Business”
Step 9: Select Your Drive
You’ll see a list of available drives:
1
config_driveid> 2
Choose option 2 (your main “OneDrive (personal)”)
Step 10: Confirm Configuration
1
2
3
4
5
Drive OK?
y/n> y
Keep this "onedrive" remote?
y/e/d> y
Step 11: Exit Configuration
1
e/n/d/r/c/s/q> q
Configuration is now complete!
Essential Workflow: The Two-Step Process
This is the core of how you’ll use rclone. Follow these two steps every time:
STEP 1: Dry Run (Always Do This First!)
See what would be copied WITHOUT actually copying anything:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive --dry-run -P --exclude "Personal Vault/**"
This shows you:
- What files would be copied
- How much data would transfer
- If there are any errors
Look at the output carefully before proceeding!
STEP 2: Actual Copy (Only After Dry Run Looks Good)
Once you’re satisfied with what the dry run showed, run the real copy:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive -P --exclude "Personal Vault/**"
What each flag means:
onedrive:/- source (your OneDrive root)/media/mark/Ext_T7_lpthp/OneDrive- destination on external drive--dry-run- (dry run only) don’t actually copy, just show what would happen-P- show progress during transfer--exclude "Personal Vault/**"- skip Personal Vault folder (prevents errors)
About Personal Vault
Personal Vault requires special authentication that rclone can’t handle. We exclude it to avoid error messages cluttering the output. If you need those files, download them manually from OneDrive.live.com.
How Rclone Works Going Forward
Key Concept: Rclone Does NOT Auto-Sync
Important: Rclone is NOT like Dropbox or OneDrive’s native clients. It does not automatically sync in the background. You must manually run rclone commands whenever you want to sync.
Copy vs Sync Commands
rclone copy (what we used)
- Copies files from source to destination
- Does NOT delete files at destination that don’t exist at source
- Safe for one-way transfers
- Use when: You want to pull down files without risking deletion
rclone sync
- Makes destination exactly match source
- WILL DELETE files at destination that don’t exist at source
- Use with caution!
- Use when: You want exact mirror of OneDrive
Example: Update Your Local Copy
To pull down any new or changed files from OneDrive:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive -P --exclude "Personal Vault/**"
Example: Upload Local Changes to OneDrive
1
rclone copy /media/mark/Ext_T7_lpthp/OneDrive onedrive:/ -P
Note: source and destination are reversed.
Example: Two-Way Sync (Advanced)
For true two-way sync where changes go both directions:
1
rclone sync /media/mark/Ext_T7_lpthp/OneDrive onedrive:/ -P --interactive
The --interactive flag will ask before making destructive changes.
Useful Rclone Features
Check What’s Different
See what would be copied without actually copying:
1
rclone check /media/mark/Ext_T7_lpthp/OneDrive onedrive:/
List Remote Files
Browse your OneDrive without downloading:
1
rclone ls onedrive:/
For a tree-style view:
1
rclone tree onedrive:/
List only directories:
1
rclone lsd onedrive:/
Download Specific Folder
Instead of everything, download just one folder:
1
rclone copy onedrive:/Documents /media/mark/Ext_T7_lpthp/OneDrive/Documents -P
Bandwidth Limiting
Limit upload/download speed if you don’t want rclone hogging bandwidth:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive -P --bwlimit 5M
This limits to 5 MB/s.
Show Transfer Stats
Get detailed statistics after transfer:
1
rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive -P --stats-one-line
Mount OneDrive as File system (Advanced)
You can mount OneDrive like a regular directory:
1
2
mkdir ~/OneDrive
rclone mount onedrive:/ ~/OneDrive --daemon
Files are downloaded on-demand when you access them. To unmount:
1
fusermount -u ~/OneDrive
Warning: Mounting can be slow over the internet and has some quirks. Best for occasional access, not primary workflow.
Ongoing Usage Strategy
Recommended Workflow
Since rclone doesn’t auto-sync, here’s a practical approach:
- For backups: Run
rclone copymanually whenever you want to back up OneDrive locally - Schedule it (optional): Set up a cron job or systemd timer if you want automatic backups
- Before major changes: Always do a dry run first with
--dry-run - Keep it simple: Use
copyinstead ofsyncunless you’re certain you want exact mirroring
Setting Up Automatic Backups (Optional)
If you want daily backups from OneDrive to your external drive:
- Create a script:
/home/mark/scripts/backup-onedrive.sh1 2 3 4 5 6 7 8 9
#!/bin/bash # Check if external drive is mounted if [ -d "/media/mark/Ext_T7_lpthp" ]; then rclone copy onedrive:/ /media/mark/Ext_T7_lpthp/OneDrive \ --log-file=/home/mark/logs/rclone-backup.log \ --exclude "Personal Vault/**" else echo "External drive not mounted" >> /home/mark/logs/rclone-backup.log fi
- Make it executable:
1
chmod +x /home/mark/scripts/backup-onedrive.sh - Add to crontab for daily 2 AM backups:
1
crontab -e
Add line:
1
0 2 * * * /home/mark/scripts/backup-onedrive.sh
Note: Only useful if your external drive stays connected.
Why Rclone Over Other Methods
vs rsync
- rsync: Only works with filesystems you can already access (local, SSH, etc.)
- rclone: Speaks cloud provider APIs directly (OneDrive, Google Drive, S3, etc.)
- You cannot use rsync with OneDrive unless you first mount it as a filesystem
vs abraunegg/onedrive
- abraunegg: Full bidirectional sync daemon (like native OneDrive client)
- rclone: Simple, command-line driven, no daemon required
- For one-time or manual syncs, rclone is simpler
- For always-on sync like Dropbox, abraunegg is better
vs Web Interface
- Web: Manual downloads only, no automation
- rclone: Scriptable, can handle large transfers, resume capability
Common Commands Reference
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# List configured remotes
rclone listremotes
# Get info about OneDrive quota/usage
rclone about onedrive:
# Download everything (excluding Personal Vault)
rclone copy onedrive:/ /path/to/local -P --exclude "Personal Vault/**"
# Upload everything
rclone copy /path/to/local onedrive:/ -P
# Sync local to match OneDrive exactly (DELETES local files not in OneDrive)
rclone sync onedrive:/ /path/to/local -P --interactive --exclude "Personal Vault/**"
# Check differences without copying
rclone check /path/to/local onedrive:/
# Browse remote files
rclone ls onedrive:/
rclone tree onedrive:/Documents
# Download specific folder
rclone copy onedrive:/Photos /path/to/local/Photos -P
# Delete old remote configuration
rclone config delete onedrive
# Re-authorize (if token expires)
rclone config reconnect onedrive:
Troubleshooting
Token Expired
If you get authentication errors after months of not using rclone:
1
rclone config reconnect onedrive:
This will refresh your OAuth token.
Can’t Access Personal Vault
This is expected. Personal Vault requires special authentication. Either:
- Download those files manually from onedrive.live.com
- Use
--exclude "Personal Vault/**"to skip it
Transfer Speed Issues
If transfers are slow:
- Check your internet connection
- Try
--transfers 4to increase parallel transfers (default is 4) - Use
--bwlimitif you’re saturating your connection and need to limit speed
Verifying File Integrity
After large transfers, verify everything copied correctly:
1
rclone check /media/mark/Ext_T7_lpthp/OneDrive onedrive:/ --one-way
Additional Resources
- Official rclone docs: https://rclone.org/
- OneDrive-specific docs: https://rclone.org/onedrive/
- rclone forum: https://forum.rclone.org/
Adding Google Drive
Rclone supports Google Drive using the same rclone config process. The key differences from OneDrive setup are noted below.
Google Drive Configuration Steps
1
rclone config
Choose n for new remote, give it a name (e.g. google-mark), then select Google Drive from the numbered list.
Key differences from OneDrive setup:
client_idandclient_secret- leave both blank, press Enter- Scope - choose
1(Full access all files) - do NOT leave blank service_account_file- leave blank, press Enter- Advanced config - choose
n - Auto config - choose
y(opens browser for Google authentication) - Shared Drive (Team Drive) - choose
nfor personal Google Drive
Important note about Google Docs/Sheets/Slides:
Google’s native formats don’t exist as real files - rclone converts them on download:
- Google Docs →
.docx - Google Sheets →
.xlsx - Google Slides →
.pptx
Regular files (PDFs, images, videos) download exactly as-is with no conversion.
Multiple Google Accounts
If you have more than one Google account, run rclone config again and create a separate remote for each one with a different name (e.g. google-mark, google-calabiyau19). Give each account its own destination folder on your external drive to avoid files from different accounts mixing together.
Google Drive Dry Run
1
rclone copy google-mark:/ /media/mark/Ext_T7_lpthp/GoogleDrive-mark --dry-run -P
Google Drive Actual Copy
1
rclone copy google-mark:/ /media/mark/Ext_T7_lpthp/GoogleDrive-mark -P
No Personal Vault exclusion needed for Google Drive.
Adding Dropbox
Same rclone config process - choose Dropbox from the numbered list, leave client ID and secret blank, use auto config to authenticate in browser.
Dropbox Dry Run
1
rclone copy dropbox-mark:/ /media/mark/Ext_T7_lpthp/Dropbox --dry-run -P
Dropbox Actual Copy
1
rclone copy dropbox-mark:/ /media/mark/Ext_T7_lpthp/Dropbox -P
Syncing All Cloud Services with One Script
Once all remotes are configured, a single script handles all four services sequentially. The script lives at ~/Scripts/sync-from-onedrive-google-dropbox.sh.
The script checks that the external drive is mounted before doing anything, then runs each service in order:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Sync all cloud storage to external drive
# External drive must be mounted at /media/mark/Ext_T7_lpthp before running
EXTERNAL="/media/mark/Ext_T7_lpthp"
# Check external drive is mounted
if [ ! -d "$EXTERNAL" ]; then
echo "ERROR: External drive not mounted at $EXTERNAL - aborting"
exit 1
fi
echo "===== Starting cloud sync $(date) ====="
echo ""
echo "--- Syncing OneDrive ---"
rclone copy onedrive:/ $EXTERNAL/OneDrive -P --exclude "Personal Vault/**"
echo ""
echo "--- Syncing Google Drive (mark) ---"
rclone copy google-mark:/ $EXTERNAL/GoogleDrive-mark -P
echo ""
echo "--- Syncing Google Drive (calabiyau19) ---"
rclone copy google-calabiyau19:/ $EXTERNAL/GoogleDrive-calabiyau19 -P
echo ""
echo "--- Syncing Dropbox ---"
rclone copy dropbox-mark:/ $EXTERNAL/Dropbox -P
echo ""
echo "===== Cloud sync complete $(date) ====="
Make it executable:
1
chmod +x ~/Scripts/sync-from-onedrive-google-dropbox.sh
Run it:
1
~/Scripts/sync-from-onedrive-google-dropbox.sh
Current Remote Configuration
1
2
3
4
5
6
Name Type
==== ====
dropbox-mark dropbox
google-calabiyau19 drive
google-mark drive
onedrive onedrive
Local folders on external drive:
/media/mark/Ext_T7_lpthp/OneDrive/media/mark/Ext_T7_lpthp/GoogleDrive-mark/media/mark/Ext_T7_lpthp/GoogleDrive-calabiyau19/media/mark/Ext_T7_lpthp/Dropbox
Summary
- Rclone is installed and configured for OneDrive, two Google Drive accounts, and Dropbox
- Use
rclone copyfor safe one-way transfers - never deletes files - Use
rclone syncwith caution (can delete files) - Rclone does NOT auto-sync - you must run it manually
- Personal Vault cannot be accessed via rclone - download manually from onedrive.live.com
- Google Docs/Sheets/Slides are converted to .docx/.xlsx/.pptx on download
- Run all four services at once with
~/Scripts/sync-from-onedrive-google-dropbox.sh