Lightweight background folder synchronization service for Windows to Google Drive.
DriveSync continuously monitors local folders using watchfiles, queues normalized file events into an SQLite database, and synchronizes changes to Google Drive using rclone's local Remote Control (RC) HTTP API.
- User Space Operation: Installs and runs without administrative privileges (
%LOCALAPPDATA%\DriveSyncand HKCU registry). - Real-Time Monitoring: Uses
watchfileswith event stability checking and rapid save coalescing. - Crash Resilience: SQLite WAL mode automatically recovers interrupted tasks on startup.
- Safety Circuit Breaker: Halts synchronization if a batch delete exceeds 50 files or 20% of tracked files.
- Standalone Binary: Can be compiled into a single executable without Python runtime requirements.
- Windows 10/11
- Python 3.11+
rcloneexecutable
-
Install package:
pip install -e .
-
(Optional) Configure personal Google Client ID and Secret (avoids shared rclone quota limits):
- Create a project in Google Cloud Console.
- Enable Google Drive API.
- Create OAuth client ID credentials (Application type: Desktop App).
- Set credentials in DriveSync:
drivesync auth credentials --client-id "YOUR_CLIENT_ID" --client-secret "YOUR_CLIENT_SECRET"
-
Authenticate Google Drive via rclone:
drivesync auth login
-
Register a folder:
drivesync folders add "C:\Users\User\Documents" --remote-path "DriveSync/Documents"
-
Start background service:
drivesync start -
Enable autostart on user login (optional):
drivesync autostart enable
To build a single-file drivesync.exe without Python runtime dependencies:
python build_exe.pyThe output executable is created at dist/drivesync.exe.
| Command | Subcommands / Actions | Description |
|---|---|---|
drivesync auth |
login / status / clear / credentials |
Manage Google Drive authentication and API credentials |
drivesync folders |
add / remove / list |
Manage watched local folders |
drivesync start |
— | Launch background daemon |
drivesync stop |
— | Stop background daemon |
drivesync status |
— | Show daemon PID, queue metrics, and circuit breaker state |
drivesync resync |
[path] |
Trigger manual 2-way baseline sync |
drivesync trash |
list / clear |
Manage local safety trash folder |
drivesync autostart |
enable / disable / status |
Manage Windows startup registry key |
drivesync circuit-breaker |
approve / status / reset |
Inspect or approve mass deletion halts |
drivesync doctor |
— | Run system health diagnostics |
drivesync logs |
[--tail N] |
View service logs |
All application data resides in user space under %LOCALAPPDATA%\DriveSync\:
config.json- Folder and remote configurationdrivesync.db- SQLite WAL state databasedrivesync.pid- Process ID filelogs/drivesync.log- Service logs
Run unit and chaos test suites:
python -m unittest discover -s tests -p "test_*.py"