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 configrclone config show — Print all configured remotes and their settings.
rclone config showrclone config show <remote> — Print the configuration of a single remote.
rclone config show gdriverclone config file — Show the path to the rclone config file.
rclone config filerclone listremotes — List all configured remote names.
rclone listremotesrclone config delete <remote> — Delete a configured remote.
rclone config delete old-remoteListing Files & Directories
rclone ls <remote>:<path> — List all files in a remote path with sizes.
rclone ls gdrive:backupsrclone lsd <remote>:<path> — List directories only.
rclone lsd gdrive:rclone lsl <remote>:<path> — List files with sizes and modification dates.
rclone lsl s3:mybucket/uploadsrclone lsf <remote>:<path> — List files and directories in a format easy to parse (one per line).
rclone lsf gdrive:photosrclone 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:photosrclone copy <remote>:<path> <localpath> — Download files from a remote to a local directory.
rclone copy gdrive:backups /tmp/restorerclone 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:docsrclone 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:docsrclone move <source> <destination> — Move files from source to destination. Deletes source files after transfer.
rclone move /tmp/uploads s3:mybucket/uploadsSingle 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.gzrclone moveto <source-file> <dest-file> — Move a single file with an explicit destination filename.
rclone moveto /tmp/export.csv gdrive:exports/report.csvrclone cat <remote>:<file> — Print the content of a remote file to stdout.
rclone cat gdrive:config/settings.jsonrclone rcat <remote>:<file> — Pipe stdin to a remote file (upload stream).
tar czf - /home/user | rclone rcat gdrive:backups/home.tar.gzDeleting & 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:temprclone purge <remote>:<path> — Delete a directory and all its contents. Destructive and cannot be undone.
rclone purge gdrive:old-backups/2020rclone deletefile <remote>:<file> — Delete a single remote file.
rclone deletefile s3:mybucket/old-export.csvrclone 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-folderrclone rmdirs <remote>:<path> — Remove all empty directories under the given path.
rclone rmdirs gdrive:archiveFilters & 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 ~/.rclonefilterrclone copy <source> <dest> --min-size <size> — Only transfer files larger than the specified size.
rclone copy gdrive:downloads /tmp --min-size 10Mrclone copy <source> <dest> --max-age <age> — Only transfer files modified more recently than the given age.
rclone copy /var/log s3:logs --max-age 24hrclone 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 .nobackupPerformance & Transfer Options
rclone copy <source> <dest> --transfers <n> — Number of file transfers to run in parallel (default: 4).
rclone copy /data s3:mybucket --transfers 16rclone 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 32rclone copy <source> <dest> --bwlimit <rate> — Limit bandwidth. Supports rates like 1M, 512k, or a timetable.
rclone copy /home/user gdrive:home --bwlimit 5Mrclone copy <source> <dest> --checksum — Use checksums instead of modification time to determine if files differ.
rclone copy /important-data s3:mybucket --checksumrclone copy <source> <dest> --dry-run — Preview what would be transferred without actually doing anything.
rclone sync /home/user gdrive:home --dry-runrclone copy <source> <dest> -P — Show real-time transfer progress.
rclone copy /home/user gdrive:home -PMount
rclone mount <remote>:<path> <mountpoint> — Mount a remote as a local filesystem (requires FUSE/WinFsp).
rclone mount gdrive: ~/gdriverclone mount <remote>:<path> <mountpoint> --read-only — Mount in read-only mode.
rclone mount s3:mybucket /mnt/s3 --read-onlyrclone mount <remote>:<path> <mountpoint> --daemon — Mount in the background as a daemon.
rclone mount gdrive: ~/gdrive --daemonrclone 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 fullServing
rclone serve http <remote>:<path> --addr :<port> — Serve a remote over HTTP.
rclone serve http gdrive:public --addr :8080rclone serve webdav <remote>:<path> --addr :<port> — Serve a remote over WebDAV.
rclone serve webdav s3:mybucket --addr :8088rclone serve sftp <remote>:<path> --addr :<port> — Serve a remote over SFTP.
rclone serve sftp gdrive: --addr :2022Hashing & Verification
rclone check <source> <destination> — Check source and destination files match (uses checksums if available, else size+modtime).
rclone check /home/user/photos gdrive:photosrclone md5sum <remote>:<path> — Calculate MD5 checksums of all files in a remote path.
rclone md5sum gdrive:docsrclone sha1sum <remote>:<path> — Calculate SHA-1 checksums of all files in a remote path.
rclone sha1sum s3:mybucket/uploadsrclone hashsum <algorithm> <remote>:<path> — Calculate checksums using the specified algorithm (MD5, SHA-1, SHA-256, etc.).
rclone hashsum SHA-256 gdrive:importantCommon 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/**' -Prclone 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/backuptar 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
- rclone – official documentation – complete reference for every command, flag and backend
- rclone – GitHub project – source code, releases and issue tracker
Related Commands
- borgbackup – deduplicating, encrypted backup program
- duplicity – encrypted, incremental backups to many storage targets
- rdiff-backup – incremental backups with reversible history