12 Essential rclone Commands for Cloud Storage on Linux

Cloud storage providers each ship their own sync client, and most of them are bad. The rclone commands in this guide replace all of them with one tool that talks to over 70 backends: Google Drive, S3, Dropbox, OneDrive, Backblaze B2, SFTP servers, and plenty more. I moved all my off-site backups to rclone years ago and never looked back.

rclone works like rsync for cloud storage. You define a remote once, then run rclone commands against it from the terminal or from cron: copy, sync, mount, verify. No GUI, no background daemon eating RAM, no vendor lock-in.

Installing rclone

Most distros package it, but the repo versions lag behind. The official install script gets you the current release:

sudo -v ; curl https://rclone.org/install.sh | sudo bash

If you’d rather stick with your package manager:

# Debian/Ubuntu
sudo apt install rclone

# Fedora
sudo dnf install rclone

# Arch
sudo pacman -S rclone

Check the version with rclone version. Anything from the last year or so is fine for everything below. The project moves fast, so grab the source or binaries from the rclone GitHub repository if you want the newest features.

First Setup: rclone config

Before any transfers happen, you need a remote. Run the interactive wizard:

rclone config

Pick n for a new remote, give it a name like gdrive or b2, then select the storage type from the list. For OAuth providers like Google Drive, rclone opens a browser to authorize. On a headless server, it prints a link you open elsewhere and paste the token back.

List your configured remotes anytime:

rclone listremotes

From here on, every path that touches the cloud uses the remote:path format, like gdrive:backups/photos. All the rclone commands below follow this pattern, and you can mix remotes freely, so copying from S3 straight to Google Drive works without a local stop in between.

Essential rclone Commands: copy, sync, and move

These three do most of the daily work, and the differences between them matter.

copy transfers files that are new or changed, and never deletes anything on the destination:

rclone copy ~/documents gdrive:backups/documents --progress

sync makes the destination identical to the source. That includes deleting files on the destination that no longer exist locally:

rclone sync ~/documents gdrive:backups/documents --progress

move transfers files and removes them from the source afterward. Useful for offloading old logs or footage you no longer need locally:

rclone move ~/old-footage b2:archive/footage --progress

The --progress flag shows live transfer stats. Without it, rclone stays silent until it finishes, which is what you want in scripts but not at the keyboard.

One habit worth building early: run destructive operations with --dry-run first. A sync pointed at the wrong directory deletes real data on the remote. The dry run prints what would happen without touching anything:

rclone sync ~/documents gdrive:backups/documents --dry-run

Browsing Remotes: ls, lsd, and tree

You don’t need a web interface to see what’s on a remote. A handful of rclone commands list contents straight from the terminal:

# List all files with sizes, recursively
rclone ls gdrive:backups

# List only directories
rclone lsd gdrive:backups

# Full tree view
rclone tree gdrive:backups

For a quick storage overview, rclone about gdrive: shows total, used, and free space on the remote, similar to what duf does for local disks.

rclone Commands for Verification and Cleanup

check compares source and destination by size and hash, and reports any mismatches:

rclone check ~/documents gdrive:backups/documents

I run this after big transfers. Silence from a backup tool is only comforting when you’ve verified it at least once.

dedupe handles a Google Drive quirk where duplicate filenames can exist in one directory:

rclone dedupe --dedupe-mode newest gdrive:backups

cleanup empties the trash or removes old file versions on remotes that support it, and delete removes files matching a filter. Deleting everything older than 90 days from an archive looks like this:

rclone delete b2:archive/logs --min-age 90d

Mounting Cloud Storage with rclone Commands

This one feels like a cheat code. mount presents any remote as a normal directory, so every application on the system can read and write cloud files directly:

mkdir -p ~/gdrive
rclone mount gdrive: ~/gdrive --vfs-cache-mode writes &

The --vfs-cache-mode writes flag buffers writes locally before uploading, which keeps applications from choking on cloud latency. Unmount with fusermount -u ~/gdrive. You’ll need the fuse3 package installed for this to work.

rclone Commands Worth Putting in a Backup Script

A nightly backup script needs three things: bandwidth limits so it doesn’t saturate your uplink, logging, and exclusions. This covers all of them:

rclone sync /home/user/data gdrive:backups/data \
  --bwlimit 8M \
  --exclude "*.tmp" \
  --exclude "node_modules/**" \
  --log-file /var/log/rclone-backup.log \
  --log-level INFO

The --bwlimit flag accepts schedules too. --bwlimit "08:00,512k 23:00,off" throttles transfers to 512 KB/s during the day and removes the cap at night. Add --transfers 8 to raise the number of parallel file transfers from the default of 4 when you’re moving thousands of small files.

Drop that in a cron entry and you have off-site backups with no subscription client software. For versioned backups with snapshots and deduplication, I pair rclone with restic, which can use an rclone remote as its storage backend. My restic backup guide covers that setup.

For moving a single large file between two machines without configuring a remote at all, croc is the faster path. The rclone commands earn their place when the destination is cloud storage and the job repeats on a schedule.

Where to Go Next

The rclone commands here cover the workflows I actually use: setup, transfers, verification, mounting, and scripted backups. The tool goes deeper. There’s rclone crypt for client-side encryption before anything leaves your machine, rclone serve to expose a remote over HTTP, WebDAV, or SFTP, and union remotes that merge several backends into one.

The official rclone documentation lists every command and the flags each one accepts. Start with copy and sync against a test directory, add --dry-run until you trust your paths, then let cron take over the boring parts.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts