rclone + systemd: Hands-Off Cloud Backup on Linux
Backing up local documentation, static IP maps, and network configs so you don't lose them when hardware fails.
Why This Matters
If you run a home lab, you probably have a folder somewhere full of things like:
- Static IP assignments and DHCP reservations
- Network topology diagrams
- Server/VM configuration notes
- VPN credentials and SSL cert info
- Docker Compose files and service maps
This is exactly the kind of documentation that is painful to reconstruct and easy to lose. A single drive failure, a misconfigured rm -rf, or a botched OS reinstall and it's gone. Syncing it to a cloud provider costs nothing meaningful and gives you off-site backup with version history.
The catch: Linux support for Google Drive and OneDrive is, charitably, an afterthought from both Google and Microsoft. You have to pick your tool carefully.
The Options
1. rclone — The Recommended Option
rclone is a free, open-source CLI tool that speaks to over 40 cloud storage backends, including Google Drive, OneDrive, S3, Backblaze B2, and more. It is the de facto standard for cloud sync on Linux and the tool this guide will focus on.
Pros:
- Free and open source
- Provider-agnostic — works with Google Drive, OneDrive, and dozens of others
- Supports encryption at rest (
rclone crypt) — useful for sensitive config data - Can be fully automated with systemd timers or cron
- Supports FUSE mounting so your cloud folder appears as a local directory
- Large, active community with thorough documentation
Cons:
- No GUI — pure CLI
- Sync is one-directional by default; bidirectional requires
rclone bisync(newer and less battle-tested) - OAuth token management can be fiddly on headless machines
- FUSE mounting works but feels less snappy than a native client
2. onedrive (abraunegg) — Best if You're OneDrive-Only
The abraunegg onedrive client is a well-maintained, free, open-source CLI client built specifically for Microsoft OneDrive on Linux.
# Arch
yay -S onedrive-abraunegg
# After auth:
onedrive --synchronizeIt supports bidirectional sync, selective folder sync, and runs as a systemd service in --monitor mode for continuous watching.
Pros:
- Free and open source
- Excellent OneDrive fidelity (handles SharePoint, Business, and Personal accounts)
- Runs as a proper daemon — real-time sync without cron jobs
- Active maintenance
Cons:
- OneDrive only — not useful for Google Drive
- CLI-only, no tray icon or GUI
- Configuration via a config file (not difficult, but not beginner-friendly)
Best for: OneDrive users who want a purpose-built daemon with real-time sync behavior.
3. GNOME Online Accounts / KDE Connect
Most Linux desktops let you hook up Google/Microsoft accounts via their accounts settings panel. This gives you file manager integration (you can browse Drive in Nautilus, for example) but it does not sync files locally. It's a network-mounted view, not a backup. Don't rely on this for anything critical.
4. Insync — Paid, Skippable
Insync is a paid (~$30/account) third-party sync client that provides a native desktop GUI experience for Google Drive and OneDrive on Linux. It's the closest thing to the official Windows/Mac clients.
It works well, but there is no meaningful capability it offers for this use case that rclone + a systemd timer doesn't cover for free. Mentioned here for completeness — skip it.
Why rclone
Of the options above, rclone is the one worth investing time in. A few reasons it stands out for this use case:
It works with whatever provider you have. Google Drive today, OneDrive tomorrow, a self-hosted S3-compatible bucket next year — the rclone command stays the same, only the remote name changes. You're not locked in to a tool that only speaks one protocol.
It's designed for unattended operation. rclone was built to run in scripts and cron jobs. It exits with a non-zero code on failure, logs cleanly to a file, and integrates naturally with systemd. A GUI sync client that assumes a logged-in desktop session is the wrong shape for a backup job that should run at 2am without thinking about it.
It's explicit about what it does. rclone copy copies. rclone sync syncs. rclone check verifies. There's no background daemon making decisions you can't see — every run does exactly what you told it to do, and you can test any command with --dry-run before committing.
Encryption is built in. If the docs folder contains anything sensitive — VPN configs, credentials, API keys — rclone crypt wraps any remote with transparent client-side encryption. The cloud provider stores ciphertext and never sees your data.
The tradeoff is that there's no GUI and no real-time sync. For a periodic backup of a documentation folder that changes infrequently, that's not a meaningful limitation.
Setting Up rclone
1. Install
# Arch / Manjaro
sudo pacman -S rclone
# Ubuntu / Debian
sudo apt install rclone
# Fedora
sudo dnf install rclone
# Or grab the latest binary directly
curl https://rclone.org/install.sh | sudo bash2. Configure a Remote
Run the interactive setup wizard:
rclone configSelect n for a new remote, give it a name (e.g. gdrive or onedrive), and follow the prompts. rclone will open a browser window for OAuth authentication. After completing the flow, your credentials are stored in ~/.config/rclone/rclone.conf.
Verify it works:
rclone ls gdrive:3. Create a Backup Folder in the Cloud
Before your first sync, create a destination folder in your cloud storage so it's easy to identify:
rclone mkdir gdrive:homelab-backup4. Run Your First Sync
rclone sync ~/homelab-docs/ gdrive:homelab-backup/ --progresssync makes the destination match the source — files deleted locally will eventually be deleted in the cloud too. If you want to keep deleted files in the cloud, use copy instead:
rclone copy ~/homelab-docs/ gdrive:homelab-backup/ --progressFor a backup use case, copy is usually the safer default — it only adds and updates, never removes.
5. Automate with a systemd Timer
systemd timers are the modern replacement for cron jobs on Linux. They come in two parts that work together:
- A service unit (
.service) — defines what to run. It's the job itself. - A timer unit (
.timer) — defines when to run the service. It wakes up on a schedule and triggers the service.
When the timer fires, systemd runs the service once and records the result in the journal. If the machine was off when the timer was supposed to fire, Persistent=true causes it to run at the next boot rather than silently skipping.
Unit files for a single user go in ~/.config/systemd/user/.
Create the service unit at ~/.config/systemd/user/homelab-backup.service:
[Unit]
Description=Sync homelab docs to cloud
[Service]
Type=oneshot
ExecStart=rclone copy /home/YOUR_USER/homelab-docs/ onedrive:homelab-backup/ --log-level INFO --log-file /home/YOUR_USER/.local/log/rclone-homelab.logCreate the timer unit at ~/.config/systemd/user/homelab-backup.timer:
[Unit]
Description=Run homelab backup daily at 2am
[Timer]
OnCalendar=*-*-* 02:00:00
Persistent=true
[Install]
WantedBy=timers.targetBefore enabling, make sure lingering is on so the timer runs even when you're not logged in:
loginctl enable-linger $USERThen enable and start the timer:
systemctl --user daemon-reload
systemctl --user enable --now homelab-backup.timer
# Confirm it's scheduled
systemctl --user list-timersTo check whether a backup ran successfully or debug a failure:
systemctl --user status homelab-backup.service
journalctl --user -u homelab-backup.service6. Optional: Keep Deleted File History
If you want to retain files that get removed from your local folder (useful if you accidentally delete something):
rclone copy ~/homelab-docs/ gdrive:homelab-backup/ \
--backup-dir gdrive:homelab-backup-archive/$(date +%Y-%m-%d) \
--log-level INFOThis moves any files that would be overwritten or deleted into a dated archive folder in your Drive before replacing them, giving you a rolling history.
7. Verify the Sync
# Check what would be copied without actually doing it
rclone copy ~/homelab-docs/ gdrive:homelab-backup/ --dry-run
# Compare local and remote to confirm they match
rclone check ~/homelab-docs/ gdrive:homelab-backup/Recommendation Summary
| Tool | Cost | GUI | Real-time | Both Providers | Best For |
|---|---|---|---|---|---|
| rclone | Free | No | No (scheduled) | Yes (+ 40 others) | Scheduled backups, scripted workflows |
| onedrive (abraunegg) | Free | No | Yes (daemon) | OneDrive only | OneDrive + real-time sync as a service |
| GNOME Online Accounts | Free | Yes | No (remote mount only) | Partial | Browsing only, not backup |
| Insync | ~$30/account | Yes | Yes | Yes | Skip — nothing free tools don't cover |
For backing up home lab documentation, rclone + a systemd timer is the right call. It's free, reliable, and requires almost no ongoing maintenance once configured. If you're on OneDrive and want real-time sync rather than scheduled runs, the abraunegg onedrive client running as a systemd service is the better fit.
Comments