Yazan Daradkeh

Senior Digital Project/Product Manager

The Hybrid Sync Setup Keeping Google Drive and OneDrive in Perfect Harmony on Ubuntu

The Hybrid Sync Setup Keeping Google Drive and OneDrive in Perfect Harmony on Ubuntu


G'day mates! Welcome back. Today, we're tackling one of the most frustrating aspects of maintaining a personal development machine: cloud file synchronization. If you are like me, you probably run a Microsoft-free environment on your personal laptop (an Ubuntu 26.04 LTS Lenovo Vostro). But if you also do client work, you know that Microsoft's shadow is long: company policy often dictates using OneDrive for work files. Meanwhile, your personal backups and home-lab configurations live happily on Google Drive.

Getting both Google Drive and OneDrive to sync reliably on a Linux workstation without creating duplicate files, sync conflicts, or destroying your CPU can be a massive headache. Today, I'm showing you the exact setup I use to keep my Google Drive and OneDrive folders in perfect harmony.

The Magic of Insync on Ubuntu

If you've tried using open-source CLI tools like rclone, you know they are great for manual or scheduled backups, but less than ideal for real-time two-way synchronization. On the other hand, the official Google Drive and OneDrive clients don't even have official Linux builds.

The solution is Insync. It is a lightweight, native client for Linux that allows you to sync multiple Google Drive and OneDrive accounts simultaneously. It integrates directly into the system tray, handles file nesting beautifully, and preserves document formatting.

Folder Layout and Ignore Rules

To keep things organized and prevent conflicts, I partition the local drive into clear directories:

Bash

/home/yazan/GoogleDrive/

/home/yazan/OneDrive/

One of the biggest traps with real-time sync clients is letting them scan directories like node_modules, vendor, or .git. Syncing hundreds of thousands of tiny dependency files to the cloud will choke your network, waste cloud storage, and trigger endless sync loops.

In the Insync settings, we add global ignore rules for standard build folders:

Bash

node_modules/

vendor/

.venv/

.git/

.DS_Store

Monitoring Sync Status via the Terminal

While Insync has a great GUI, as developers, we spend most of our time in the terminal. Insync exposes a handy CLI utility called insync-cmd that allows you to monitor and control the sync engine.

Here is a short bash script I write to check the status of both my Google Drive and OneDrive syncs at a glance. It uses the CLI tool to print out whether the engine is active, paused, or currently uploading files:

Bash

#!/usr/bin/env bash

set -euo pipefail

echo "=== Insync Synchronization Status ==="

if ! command -v insync &> /dev/null; then

echo "Insync CLI is not installed or not in PATH."

exit 1

fi

STATUS=$(insync get_status)

echo "Current Status: $STATUS"

SYNCING_FILES=$(insync get_syncing_files)

if [ -n "$SYNCING_FILES" ]; then

echo "Currently syncing files:"

echo "$SYNCING_FILES" | head -n 5

else

echo "No files are currently syncing. Everything is up to date."

fi

Make the script executable:

Bash

chmod +x ~/bin/check_sync.sh

Now, checking on my cloud backups is as simple as running a single command from my shell.

Redundancy is Key

With this setup, all of my personal files are backed up on Google Drive, and work files are backed up on OneDrive and my personal Google Drive. The sync is bidirectional and runs silently in the background of my Ubuntu 26.04 workstation. If my laptop ever dies, spinning up a new one and restoring my environment is just a matter of installing Insync and pointing it to the cloud folders.

And that's a wrap! Let me know if you are managing a hybrid sync setup on Linux or what tools you use for cloud backups. Cheers!

"If you've got any questions or need a hand wrangling your own setup, don't hesitate to reach out at [email protected] or connect with me via www.yazan.me. I'm always keen to help out!"