A lightweight Linux sync client for Microsoft OneDrive that runs as a background service with a GTK graphical interface.
- Background Sync: Automatically syncs files between local directory and OneDrive
- Real-time Monitoring: Detects file changes instantly using filesystem events
- Native GTK Interface: Clean GNOME-style GUI for managing files
- System Tray Indicator: Quick access menu in taskbar when daemon is running
- Selective Sync: Choose which files to download and keep in sync
- Secure Authentication: OAuth2 with encrypted token storage
- Force Sync: Manual sync trigger via GUI menu
- Folder Sync: Bidirectional folder syncing including empty folders
ODSC graphical interface showing file browser with selective sync controls
- Linux with GTK 3.0+ (Ubuntu 20.04+, Fedora 33+, etc.)
- Python 3.8 or higher
- Microsoft account with OneDrive
One command — no git required:
curl -fsSL https://github.com/marlobello/odsc/releases/latest/download/install.sh | bashOr download and inspect first:
curl -fsSL https://github.com/marlobello/odsc/releases/latest/download/install.sh -o install.sh
bash install.shUpgrading? Just re-run the same command. The installer detects and upgrades your existing installation.
The install script will:
- ✅ Check Python version (requires 3.8+)
- ✅ Install all system dependencies (GTK, D-Bus, Python packages)
- ✅ Install ODSC application
- ✅ Create default sync directory (
~/OneDrive) - ✅ Install application icon
- ✅ Set up systemd service (optional)
- ✅ Add GUI to application menu (optional)
That's it! The script handles everything automatically.
git clone https://github.com/marlobello/odsc.git
cd odsc
bash install.sh --devFind "OneDrive Sync Client" in your applications menu, or run:
odsc-gui- Click Authentication → Login in the menu
- Your browser will open for Microsoft login
- Sign in with your Microsoft account
- Authorize the application
- Return to the GUI (authentication completes automatically)
The background sync daemon should already be running if you enabled the systemd service during installation.
Check daemon status:
systemctl --user status odscStart daemon manually (if not using systemd):
odsc-daemon- New or modified local files → Automatically uploaded to OneDrive
- Detected via: Real-time filesystem monitoring + periodic scans
- New OneDrive files → Appear in GUI but NOT auto-downloaded
- To download: Select files and click "Keep Local Copy"
- Once downloaded: File stays in sync automatically
- Click Settings → Force Sync Now to trigger immediate sync
When the sync daemon is running, an icon appears in the GNOME taskbar with quick access to:
- Live Status: Shows current sync status
- Open GUI: Launch or focus the main application window
- Stop Service: Gracefully stop the sync daemon
- About: Link to the GitHub repository
Note: System tray requires a graphical environment. Headless/server installations run without the tray icon.
ODSC will NEVER delete files from OneDrive automatically.
- Remote deletions → Local files moved to trash (not permanently deleted)
- Local deletions → Files remain on OneDrive (prevents accidental loss)
- Conflicts → Both versions kept (
.conflictfile created) - "Do No Harm" → Design priority is to never destroy or lose OneDrive data
| Scenario | What Happens | OneDrive Status |
|---|---|---|
| You delete a file locally | Sync daemon detects deletion and skips it | ✅ File remains on OneDrive |
| You delete a file on OneDrive | Sync daemon moves local copy to trash | File already deleted |
| You delete a folder locally | Sync daemon does not sync the deletion | ✅ Folder remains on OneDrive |
| You delete a folder on OneDrive | Sync daemon removes local copy | Folder already deleted |
Key Principle: Local deletions are never propagated to OneDrive. Only additions and modifications sync bidirectionally. This prevents accidental data loss.
To delete files from OneDrive, use the web interface or official Microsoft clients.
Warning
Large-scale folder organizational changes (mass renames, deep restructuring) on the Linux side have not been extensively tested and are generally not recommended. This tool is designed to provide simple and reliable file syncing capabilities, not complex file management operations. For major organizational changes, use the OneDrive web interface or official clients.
Settings are stored in ~/.config/odsc/config.json and can be changed via the GUI:
Settings → Preferences:
- Sync Directory: Where files are stored locally (default:
~/OneDrive) - Sync Interval: How often to check for changes (default: 300 seconds)
- Log Level: Verbosity of logging (INFO, DEBUG, WARNING, ERROR)
- Select files without local copies in the GUI
- Click "Keep Local Copy" button
- Files download and will now auto-sync
- Select files with local copies
- Click "Remove Local Copy" button
- Local files deleted, but remain on OneDrive
- Files stop syncing until you "Keep Local Copy" again
Logs are automatically viewable in the GUI:
- Click View → Logs to see real-time sync activity
Or view from terminal:
tail -f ~/.config/odsc/odsc.logTry one of these:
# Option 1: Search for it
# Press Super key, type "OneDrive"
# Option 2: Launch from terminal
odsc-gui# Check if daemon is running
systemctl --user status odsc
# View daemon logs
journalctl --user -u odsc -f
# Restart daemon
systemctl --user restart odscCaution
This will delete all local files and re-download from OneDrive!
# See what would be deleted (safe)
odsc-reset-local --dry-run
# Actually reset local state (requires --force)
odsc-reset-local --force
# Reset without auto-restarting daemon
odsc-reset-local --force --no-restartThis utility:
- Stops the daemon
- Deletes ALL local files and folders
- Clears sync state and cache
- Keeps authentication token
- Re-syncs everything from OneDrive (treated as authoritative)
Use this when local state becomes corrupted or you want a fresh start.
- Ensure port 8080 is available
- Check internet connection
- Try Authentication → Login again
# Uninstall
pip3 uninstall odsc -y
# Reinstall
./install.shodsc-gui # Launch GUI application
odsc-daemon # Run sync daemon (if not using systemd)
odsc auth # Authenticate from command line
odsc status # View sync status
odsc-reset-local # Reset local state (ADVANCED - see Troubleshooting)# Check status
systemctl --user status odsc
# Start/stop
systemctl --user start odsc
systemctl --user stop odsc
# Restart (after config changes)
systemctl --user restart odsc
# Enable/disable auto-start
systemctl --user enable odsc
systemctl --user disable odsc
# View logs
journalctl --user -u odsc -f~/.config/odsc/
├── config.json # Configuration file
├── sync_state.json # Sync state and cache
├── .onedrive_token # Encrypted authentication token
└── odsc.log # Application logs
~/OneDrive/ # Default sync directory (configurable)
~/.local/bin/ # Installed executables
├── odsc-gui
├── odsc-daemon
├── odsc
└── ...
# Stop and disable service
systemctl --user stop odsc
systemctl --user disable odsc
# Uninstall package
pip3 uninstall odsc -y
# Remove configuration (optional)
rm -rf ~/.config/odsc
# Remove desktop entry (optional)
rm ~/.local/share/applications/com.github.odsc.desktop
# Remove sync directory (optional - contains your files!)
# rm -rf ~/OneDrive- ✅ OAuth2 authentication with CSRF protection
- ✅ Encrypted token storage using system keyring
- ✅ SSL/TLS certificate validation
- ✅ Path traversal protection
- ✅ No sensitive data in logs
MIT License - See LICENSE file for details.
Contributions welcome! Please submit a Pull Request on GitHub.
- Issues: Report bugs on the GitHub Issues page
- Logs: Check
~/.config/odsc/odsc.logfor debugging information
