Skip to content

klytron/gdsync-linux

GDSync Linux

The Google Drive sync client Linux never had.

Google Drive has an official desktop sync client for Windows and macOS — but not Linux. GDSync Linux fills that gap: a fast, reliable, bidirectional sync daemon built in Python, with a clean CLI, systemd integration, and production-grade reliability.

Python 3.10+ License MIT Platform Linux Test Coverage PRs Welcome


Why GDSync Linux?

Google officially supports Drive sync on Windows and macOS. Linux users are left with:

  • Manual uploads via the web browser
  • Third-party paid tools (Insync ~$30/device)
  • rclone — powerful but complex, not a real-time daemon

GDSync Linux provides what the others don't: a free, open-source, real-time sync daemon that works like the native clients — just for Linux.


Features

Core Synchronization

  • Bidirectional Real-Time Sync — Local ↔ Google Drive, always in step
  • Smart Move/Rename Detection — Avoids re-uploading unchanged files (300× faster)
  • Enhanced Dry-Run Mode — Preview with MD5 checksum comparison before syncing
  • Root Sync & Sandbox Modes — Direct My Drive sync or isolated testing environment
  • Conflict Resolution — Multiple strategies: newest, local, remote, keep-both
  • Automated Cleanup — Self-managing reports and logs with configurable retention

Performance & Reliability

  • Ghost Guard™ Technology — Proactive deduplication via MD5 hashes; never creates duplicates on Drive
  • MD5 Checksum Validation — Ensures file integrity and prevents redundant uploads
  • Graceful Error Handling — Comprehensive logging and recovery mechanisms
  • Daemon Mode — Background operation with systemd integration
  • Automatic Restart — systemd auto-recovery on crash or failure

Developer Experience

  • Zero-Touch Installation — Fully automated setup script
  • One-Command Updates — Seamless version updates with automatic backup
  • Rich CLI Interface — Colors, progress indicators, detailed output (powered by rich)
  • Comprehensive Logging — Structured logs with journald integration
  • 87% Test Coverage — 72/82 tests passing, with mocked Drive API

Requirements

  • Python 3.10 or higher
  • Linux (any modern distro with systemd)
  • A Google Cloud project with the Drive API enabled (free — see setup guide)

Installation

Quick Install (Recommended)

git clone https://github.com/klytron/gdsync-linux.git
cd gdsync-linux
bash scripts/install.sh

From Source (Development)

git clone https://github.com/klytron/gdsync-linux.git
cd gdsync-linux

# Create virtual environment
python -m venv venv
source venv/bin/activate

# Install in development mode
pip install -e ".[dev]"

Google Cloud Setup

Before syncing, create OAuth credentials (one-time, ~5 min):

  1. Go to Google Cloud Console → create/select a project
  2. Enable Google Drive API (APIs & Services → Library)
  3. Configure OAuth Consent Screen (External, add your email as test user)
  4. Create OAuth Client ID → Desktop app → download JSON
  5. Save it as ~/.config/gdsync-linux/client_secret.json

📖 Full step-by-step: docs/google-cloud-setup.md


Usage

# 1. Authenticate with Google Drive
gdsync auth

# 2. Preview what would be synced (safe dry-run)
gdsync add ~/MyDrive --dry-run

# 3. Start syncing a folder (root mode — syncs directly to My Drive/)
gdsync add ~/MyDrive

# 4. Start syncing in sandbox mode (safe for testing)
gdsync add ~/test-folder --sandbox

# 5. Start the background daemon
gdsync start

# 6. Check sync status
gdsync status

# 7. Stop the daemon
gdsync stop

Managing Sync Folders

gdsync list                          # List all synced folders with mode badges
gdsync add /path/to/folder           # Root mode (syncs to My Drive/)
gdsync add /path/to/folder --sandbox # Sandbox mode (syncs to My Drive/GDSync Linux/)
gdsync remove /path/to/folder        # Remove from sync

Conflict Resolution

gdsync conflicts                                # View current conflicts
gdsync resolve <conflict-id> --strategy newest  # Resolve (newest/local/remote/keep-both)

📖 Full CLI reference: docs/cli-reference.md


Configuration

Config file: ~/.config/gdsync-linux/config.yaml

# Polling interval (seconds)
poll_interval: 60

# Default conflict strategy
conflict_strategy: newest  # newest | local | remote | keep-both

# Sync folders
sync_folders:
  - path: /home/user/MyDrive
    sandbox_mode: false       # root sync (default)
  - path: /home/user/testing
    sandbox_mode: true        # sandbox mode

# Exclusion patterns (glob)
exclude:
  - "*.tmp"
  - "*.swp"
  - ".git/"
  - "__pycache__/"
  - ".DS_Store"

# Logging
log_level: INFO

# Optional bandwidth limits (bytes/sec, 0 = unlimited)
upload_limit: 0
download_limit: 0

📖 Full config reference: docs/configuration.md


Architecture

┌─────────────────────────────────────────────────────────────┐
│                        GDSync Linux                         │
├─────────────────────────────────────────────────────────────┤
│                                                             │
│  ┌─────────────┐    ┌─────────────┐    ┌─────────────────┐  │
│  │   CLI/GUI   │───▶│   Daemon    │───▶│   Sync Engine   │  │
│  └─────────────┘    └─────────────┘    └─────────────────┘  │
│                                               │             │
│                           ┌───────────────────┼───────────┐ │
│                           ▼                   ▼           │ │
│                    ┌─────────────┐    ┌─────────────────┐ │ │
│                    │  FS Monitor │    │  GDrive Client  │ │ │
│                    └─────────────┘    └─────────────────┘ │ │
│                           │                   │           │ │
│                           ▼                   ▼           │ │
│                    ┌─────────────┐    ┌─────────────────┐ │ │
│                    │ Local Files │    │  Google Drive   │ │ │
│                    └─────────────┘    └─────────────────┘ │ │
│                                                           │ │
│                    ┌─────────────────────────────────────┐│ │
│                    │         SQLite Database             ││ │
│                    │   (file states, sync history)       ││ │
│                    └─────────────────────────────────────┘│ │
└─────────────────────────────────────────────────────────────┘

📖 Full architecture docs: docs/architecture.md


Documentation

Guide Description
Quickstart Get syncing in 5 minutes
Installation Guide Full install options
Google Cloud Setup Set up OAuth credentials
CLI Reference All commands & flags
Configuration Full config options
Sync Behavior How sync works in detail
Conflict Resolution Handling conflicts
Architecture Code structure & design
Troubleshooting Common issues & fixes
FAQ Frequently asked questions
Contributing How to contribute

Development

# Install with dev dependencies
pip install -e ".[dev]"

# Run test suite
pytest

# Check coverage
pytest --cov=gdsync_linux --cov-report=html

# Lint
ruff check src/

# Format
black src/

# Type check
mypy src/

Contributing

Contributions are very welcome! Please read CONTRIBUTING.md first.


Security

If you discover a security vulnerability, please read SECURITY.md for responsible disclosure instructions. Do not open public issues for security vulnerabilities.


License

MIT License © 2026 Michael K. Laweh

See LICENSE for full terms.


Author

Michael K. Laweh — Senior IT Consultant & Full-Stack Developer

About

The Google Drive sync client Linux never had.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors