rclone — Sync and Manage Cloud Storage

Practical guide to rclone — manage, sync and back up files across 70+ cloud backends like S3, Google Drive, Dropbox and SFTP from one command line.

rclone is the Swiss Army knife for cloud storage: a single command-line tool that manages files across more than 70 backends – from S3 and Google Drive to Dropbox, SFTP and Backblaze B2. You copy, sync, encrypt and mount remote storage with the same familiar commands, no matter which provider sits behind them. This guide walks you through the commands you reach for daily: configuration, backup and keeping data in sync.

Configuration

rclone config — Interactive wizard to add, edit, or remove remotes.

rclone config

rclone config show — Print all configured remotes and their settings.

rclone config show

rclone config show <remote> — Print the configuration of a single remote.

rclone config show gdrive

rclone config file — Show the path to the rclone config file.

rclone config file

rclone listremotes — List all configured remote names.

rclone listremotes

rclone config delete <remote> — Delete a configured remote.

rclone config delete old-remote

Listing Files & Directories

rclone ls <remote>:<path> — List all files in a remote path with sizes.

rclone ls gdrive:backups

rclone lsd <remote>:<path> — List directories only.

rclone lsd gdrive:

rclone lsl <remote>:<path> — List files with sizes and modification dates.

rclone lsl s3:mybucket/uploads

rclone lsf <remote>:<path> — List files and directories in a format easy to parse (one per line).

rclone lsf gdrive:photos

rclone lsjson <remote>:<path> — List files as a JSON array with metadata.

rclone lsjson gdrive:photos | jq '.[].Name'

rclone ncdu <remote>:<path> — Interactive disk usage browser (like ncdu) for remote storage.

rclone ncdu gdrive:

Copying & Syncing

rclone copy <source> <destination> — Copy files from source to destination. Does not delete destination files.

rclone copy /home/user/photos gdrive:photos

rclone copy <remote>:<path> <localpath> — Download files from a remote to a local directory.

rclone copy gdrive:backups /tmp/restore

rclone sync <source> <destination> — Makes the destination identical to the source by deleting extra files in the destination. Destructive – unlike rclone copy; always test a run with --dry-run first.

rclone sync /home/user/docs gdrive:docs

rclone sync <source> <destination> --backup-dir <dir> — Move deleted/replaced files to a backup directory instead of deleting them.

rclone sync /home/user gdrive:home --backup-dir gdrive:home-backups/$(date +%F)

rclone bisync <source> <destination> — Bidirectional sync: propagates changes in both directions.

rclone bisync /home/user/docs gdrive:docs

rclone move <source> <destination> — Move files from source to destination. Deletes source files after transfer.

rclone move /tmp/uploads s3:mybucket/uploads

Single File Operations

rclone copyto <source-file> <dest-file> — Copy a single file with an explicit destination filename.

rclone copyto backup.tar.gz s3:mybucket/archive/backup-2024-01-15.tar.gz

rclone moveto <source-file> <dest-file> — Move a single file with an explicit destination filename.

rclone moveto /tmp/export.csv gdrive:exports/report.csv

rclone cat <remote>:<file> — Print the content of a remote file to stdout.

rclone cat gdrive:config/settings.json

rclone rcat <remote>:<file> — Pipe stdin to a remote file (upload stream).

tar czf - /home/user | rclone rcat gdrive:backups/home.tar.gz

Deleting & Cleaning

rclone delete <remote>:<path> — Delete all files in a remote path; directories are left in place. Destructive – check with --dry-run first.

rclone delete gdrive:temp

rclone purge <remote>:<path> — Delete a directory and all its contents. Destructive and cannot be undone.

rclone purge gdrive:old-backups/2020

rclone deletefile <remote>:<file> — Delete a single remote file.

rclone deletefile s3:mybucket/old-export.csv

rclone cleanup <remote>: — Clean up old versions and trash. Behavior depends on the backend.

rclone cleanup gdrive:

rclone rmdir <remote>:<path> — Remove an empty directory.

rclone rmdir gdrive:empty-folder

rclone rmdirs <remote>:<path> — Remove all empty directories under the given path.

rclone rmdirs gdrive:archive

Filters & Exclusions

rclone copy <source> <dest> --exclude <pattern> — Exclude files matching a pattern from the operation.

rclone copy /home/user gdrive:home --exclude 'node_modules/**'

rclone copy <source> <dest> --include <pattern> — Include only files matching a pattern.

rclone copy /home/user/docs gdrive:docs --include '*.pdf'

rclone copy <source> <dest> --filter-from <file> — Read include/exclude rules from a file. Lines starting with + include, - exclude.

rclone copy /home/user gdrive:home --filter-from ~/.rclonefilter

rclone copy <source> <dest> --min-size <size> — Only transfer files larger than the specified size.

rclone copy gdrive:downloads /tmp --min-size 10M

rclone copy <source> <dest> --max-age <age> — Only transfer files modified more recently than the given age.

rclone copy /var/log s3:logs --max-age 24h

rclone copy <source> <dest> --exclude-if-present <filename> — Skip directories that contain the specified file (e.g. .rcloneignore).

rclone copy /home/user gdrive:home --exclude-if-present .nobackup

Performance & Transfer Options

rclone copy <source> <dest> --transfers <n> — Number of file transfers to run in parallel (default: 4).

rclone copy /data s3:mybucket --transfers 16

rclone copy <source> <dest> --checkers <n> — Number of checkers to run in parallel (default: 8). Checkers verify file state before transfer.

rclone copy /data s3:mybucket --checkers 32

rclone copy <source> <dest> --bwlimit <rate> — Limit bandwidth. Supports rates like 1M, 512k, or a timetable.

rclone copy /home/user gdrive:home --bwlimit 5M

rclone copy <source> <dest> --checksum — Use checksums instead of modification time to determine if files differ.

rclone copy /important-data s3:mybucket --checksum

rclone copy <source> <dest> --dry-run — Preview what would be transferred without actually doing anything.

rclone sync /home/user gdrive:home --dry-run

rclone copy <source> <dest> -P — Show real-time transfer progress.

rclone copy /home/user gdrive:home -P

Mount

rclone mount <remote>:<path> <mountpoint> — Mount a remote as a local filesystem (requires FUSE/WinFsp).

rclone mount gdrive: ~/gdrive

rclone mount <remote>:<path> <mountpoint> --read-only — Mount in read-only mode.

rclone mount s3:mybucket /mnt/s3 --read-only

rclone mount <remote>:<path> <mountpoint> --daemon — Mount in the background as a daemon.

rclone mount gdrive: ~/gdrive --daemon

rclone mount <remote>:<path> <mountpoint> --vfs-cache-mode full — Enable full VFS cache for better performance with random-access applications.

rclone mount gdrive: ~/gdrive --vfs-cache-mode full

Serving

rclone serve http <remote>:<path> --addr :<port> — Serve a remote over HTTP.

rclone serve http gdrive:public --addr :8080

rclone serve webdav <remote>:<path> --addr :<port> — Serve a remote over WebDAV.

rclone serve webdav s3:mybucket --addr :8088

rclone serve sftp <remote>:<path> --addr :<port> — Serve a remote over SFTP.

rclone serve sftp gdrive: --addr :2022

Hashing & Verification

rclone check <source> <destination> — Check source and destination files match (uses checksums if available, else size+modtime).

rclone check /home/user/photos gdrive:photos

rclone md5sum <remote>:<path> — Calculate MD5 checksums of all files in a remote path.

rclone md5sum gdrive:docs

rclone sha1sum <remote>:<path> — Calculate SHA-1 checksums of all files in a remote path.

rclone sha1sum s3:mybucket/uploads

rclone hashsum <algorithm> <remote>:<path> — Calculate checksums using the specified algorithm (MD5, SHA-1, SHA-256, etc.).

rclone hashsum SHA-256 gdrive:important

Common Recipes

rclone sync /home/user gdrive:home --exclude '.cache/**' --exclude 'node_modules/**' -P — Sync home directory to Google Drive, excluding cache and node_modules, with progress.

rclone sync /home/user gdrive:home --exclude '.cache/**' --exclude 'node_modules/**' -P

rclone copy <source> <dest1>: && rclone copy <source> <dest2>: — Backup to two different cloud providers for redundancy.

rclone copy /data gdrive:backup && rclone copy /data b2:mybucket/backup

tar czf - <path> | rclone rcat <remote>:<file.tar.gz> — Create a tar archive on-the-fly and stream it directly to a remote.

tar czf - /var/www | rclone rcat s3:mybucket/www-$(date +%F).tar.gz

Conclusion

rclone abstracts away each provider's quirks: once a remote is configured, you talk to every cloud backend with the same commands. Keep the difference between copy (only adds) and sync (makes the destination identical and deletes extra files) firmly in mind – and always preview destructive runs with --dry-run first. That makes rclone a dependable backbone for backups, migrations and data sync.

Further Reading

  • borgbackup – deduplicating, encrypted backup program
  • duplicity – encrypted, incremental backups to many storage targets
  • rdiff-backup – incremental backups with reversible history