Skip to content

Instantly share code, notes, and snippets.

@nprasad2077
Last active November 13, 2026 01:04
Show Gist options
  • Select an option

  • Save nprasad2077/52a83c840b91ae53112c88a4bfa2898b to your computer and use it in GitHub Desktop.

Select an option

Save nprasad2077/52a83c840b91ae53112c88a4bfa2898b to your computer and use it in GitHub Desktop.
rclone Command & Optimization Guide

rclone Command & Optimization Guide

T3 Guide Β· V2.1 β€” commands, tuning profiles and production recipes

rclone 1.6x – 1.7x (tested v1.75+) Β· S3 Β· R2 Β· Google Drive Β· TorBox T3 Β· GoFile

Note

Check your build before you copy a flag. rclone version shows the version Β· rclone help flags confirms a flag exists Β· rclone selfupdate updates the binary (not on package-manager installs).


Contents

# Section Go here when you need to…
1 Golden rules Avoid losing data on your first run
2 Paths & filtering Understand where files land, include or exclude files
3 Configuration & remotes Set up, protect or script a remote
4 Command reference Look up what a command does and how risky it is
5 Tuning engine Set concurrency, memory, compare mode, bandwidth, logging
6 Scenario profiles Copy a ready-made command for a specific route
7 VFS mount recipes Mount a remote as a filesystem
8 Automation Run jobs from scripts, systemd services and timers
9 Verification & troubleshooting Confirm a transfer or fix an error
10 Decision matrix Pick starting flags in 10 seconds

Risk legend used throughout: 🟒 Low Β· 🟑 Medium Β· πŸ”΄ High (can delete data)


1. Golden rules

Rule How
βœ… Test first --dry-run, or -i for interactive prompts, before any sync, move or delete
βœ… Prefer copy over sync If you must sync, add --backup-dir on the same remote, outside the destination path
βœ… Know where the bytes flow Client-side transfers pass every byte through the rclone machine, so run them on a VPS with a fast uplink
βœ… Respect the slowest limit Usually a provider's rate limit or daily quota, not your bandwidth
βœ… Do the memory math See Memory formula before raising --transfers, --s3-chunk-size or --s3-upload-concurrency
βœ… Log long jobs --log-file, and run inside tmux, screen or systemd
βœ… Verify afterwards rclone check β€” see section 9

2. Paths & filtering

Directory contents, not the directory

Important

rclone copies the contents of the source directory, not the directory itself. A trailing slash on the source makes no difference.

# Source: /data/photos/a.jpg, /data/photos/b.jpg
rclone copy /data/photos s3:my-bucket/backup
# Result: s3:my-bucket/backup/a.jpg, s3:my-bucket/backup/b.jpg

# To keep the folder name, put it in the destination:
rclone copy /data/photos s3:my-bucket/backup/photos

Path formats

Target Syntax Note
Local /path/to/dir Β· C:\path\to\dir
Remote remote:bucket/path On S3-type remotes the first segment is the bucket
Remote root remote:
Single file, renamed copyto / moveto Use when you want to name the destination file

Filtering

Applies to most commands.

Flag Effect
--include "*.mkv" Β· --exclude "*.tmp" Pattern filters. Order matters β€” first match wins
--filter-from rules.txt File of + include / - exclude rules
--files-from list.txt Explicit list of relative paths
--min-size 10M Β· --max-size 50G Size window
--min-age 15m Β· --max-age 30d Age window. --min-age skips files still being written
--max-depth 2 Limit recursion

3. Configuration & remotes

OS Config location
Linux / macOS ~/.config/rclone/rclone.conf
Windows %APPDATA%\rclone\rclone.conf
Any rclone config file prints the exact path

Config commands

Command Does
rclone config Interactive wizard
rclone listremotes List configured remotes
rclone config show INI output. Passwords obscured, not redacted
rclone config redacted βœ… Safe to paste into forum posts or support tickets
rclone config dump JSON output
rclone config create NAME TYPE key=value ... Non-interactive creation
rclone obscure "password" Obscure a password for the config file

Protect the config

Caution

Your keys sit in rclone.conf in cleartext or obscured form. Obscured is not encrypted.

rclone config encryption set           # password-protect rclone.conf
export RCLONE_CONFIG_PASS='...'        # unattended runs (or use --password-command)
chmod 600 ~/.config/rclone/rclone.conf

Environment variables

Any flag becomes RCLONE_ + flag name, uppercase, hyphens β†’ underscores:

export RCLONE_TRANSFERS=16
export RCLONE_CHECKERS=32

Tip

You can define a whole remote with no config file β€” handy in CI:

export RCLONE_CONFIG_MYS3_TYPE=s3
export RCLONE_CONFIG_MYS3_PROVIDER=AWS
export RCLONE_CONFIG_MYS3_ENV_AUTH=true
rclone lsd mys3:

Example remotes

Cloudflare R2TorBox T3 (read-only)
[r2]
type = s3
provider = Cloudflare
access_key_id = ...
secret_access_key = ...
endpoint = https://<ACCOUNT_ID>.r2.cloudflarestorage.com
acl = private
# needed if the token can't create buckets
no_check_bucket = true
[torbox]
type = s3
provider = Other
access_key_id = <TorBox Auth ID>
secret_access_key = <TorBox API key>
endpoint = https://t3.nexus
force_path_style = true
no_check_bucket = true
# TorBox requires v2 signatures; "Other"
# defaults to v2. To force: v2_auth = true
GoFile (Native in 1.7x)Google Drive (Custom OAuth)
[gofile]
type = gofile
access_token = <GoFile API token>
# Optional: lock remote to a specific folder:
# root_folder_id = <folder_id>
[gdrive]
type = drive
client_id = <ID>.apps.googleusercontent.com
client_secret = <SECRET>
scope = drive
# token generated via: rclone config reconnect gdrive:

4. Command reference

Transfer

Command Behavior Risk
copy src dst Copies new/changed files. Never deletes on dst. The default choice 🟒
sync src dst Makes dst identical to src. Deletes extra files on dst πŸ”΄
move src dst Copies, then deletes from source. Fails on read-only sources 🟑
copyto / moveto As above, but dst is an explicit file or folder name 🟒 / 🟑
copyurl url dst Downloads an HTTP(S) URL straight into a remote 🟒
bisync a b Two-way sync with state tracking. First run needs --resync πŸ”΄

Warning

Run sync, move and bisync with --dry-run first. Every πŸ”΄ command can remove files you meant to keep.

Listing & audit

Command Output
ls Recursive Β· size + path
lsl Recursive Β· size + modtime + path
lsd Directories/buckets, one level
lsf Machine-friendly. --format "pst" = path, size, time; add h and --hash md5 for hashes
lsjson Structured JSON (add --hash, --fast-list, -R)
tree ASCII tree
size Object count + total bytes (--json available)
about remote: Quota / used / free, where supported
ncdu remote: Interactive disk-usage browser. There is no du command

Verification

Command Purpose
check src dst Compares size and hash. Flags: --size-only, --download, --one-way, --combined FILE
cryptcheck plain crypt: Checks unencrypted data against a crypt remote
md5sum Β· sha1sum Β· hashsum TYPE Outputs checksums. --download computes locally if the backend has none

Deletion & lifecycle

Command Operation Risk
delete Deletes files matching filters; keeps directories πŸ”΄
deletefile Deletes one file 🟑
rmdir / rmdirs Removes empty dirs. rmdirs --leave-root keeps the top folder 🟒
purge Irrevocably removes a path and everything under it πŸ”΄
cleanup Empties Drive trash, or removes stale incomplete S3 multipart uploads 🟑

Mount & serve

Command Description
mount remote:path /mnt/x FUSE mount with VFS caching β€” see section 7
nfsmount Mount via a built-in NFS server where FUSE isn't available
serve http|webdav|sftp|ftp|s3|dlna|nfs|restic Expose a remote over a protocol

Utility

Command Use
cat / rcat Stream to stdout / from stdin, e.g. tar cf - . | rclone rcat s3:b/t.tar
dedupe Fix duplicate names (Drive, OneDrive)
settier Change storage tier (Glacier, Archive, etc.)
backend CMD remote: Provider-specific commands (e.g. S3 restore)
selfupdate Update the binary

5. Tuning engine

Concurrency

Flag Controls Default
--checkers N Threads comparing source vs destination 8
--transfers N Whole files in flight at once 4
--buffer-size SIZE In-memory read buffer per transfer 16Mi
--max-buffer-memory SIZE Hard global ceiling on total buffer memory allocated across all transfers off
--s3-upload-concurrency N Parts of one file uploaded in parallel 4
--s3-chunk-size SIZE Size of each part 5Mi
--multi-thread-streams N Parallel streams for one file when writing to local disk. Only for files above --multi-thread-cutoff (default 256Mi) 4
--multi-thread-chunk-size SIZE Chunk size per stream in multi-thread download 64Mi

Warning

Connections multiply: total β‰ˆ transfers Γ— s3-upload-concurrency. Providers with connection caps β€” debrid services, GoFile, Drive β€” punish this.

Multipart limits

S3 allows at most 10,000 parts per object.

  • Known-size files: rclone raises the chunk size automatically.
  • Streamed uploads (rcat) of unknown size: the default 5Mi chunk caps you at β‰ˆ 48 GiB. Set --s3-chunk-size explicitly.

Memory formula

Peak RAM β‰ˆ transfers Γ— (s3-chunk-size Γ— s3-upload-concurrency + buffer-size)
           + checkers Γ— ~1 MB
           + listing memory

Worked example

--transfers --s3-chunk-size --s3-upload-concurrency --buffer-size Peak RAM
16 64M 8 32M 16 Γ— (512 + 32) MB β‰ˆ 8.7 GB

Safety valves, in order of impact

  1. Lower --s3-upload-concurrency first β€” it multiplies memory fastest.
  2. Set --max-buffer-memory 4G β€” caps the global buffer allocation, preventing out-of-memory crashes on systems with constrained RAM.
  3. Add --use-mmap β€” instructs the Go memory allocator to release freed buffer memory back to the operating system sooner.

Compare modes

How rclone decides a file is already up to date.

Mode Flag Speed Notes
Size + modtime (default) ●●○ On S3 sources can cost a HEAD request per object
Size only --size-only ●●● Misses same-size edits. Best when hashes are incomparable (e.g. TorBox β†’ R2)
Size + hash --checksum ●○○ Needs a hash both sides share; reads every local file
Skip if present --ignore-existing ●●● Fastest for append-only archives
Newer only --update ●●○ Add --use-server-modtime to avoid HEADs on S3

Listing & API limits

Flag Effect Use when / caution
--fast-list Recursive listing in few API calls Big trees on S3/B2/Drive. ⚠️ Uses RAM (β‰ˆ 0.5–1 GB per million objects). Pointless with --no-traverse
--no-traverse Skips listing the destination; checks files individually Few files going into a huge destination
--tpslimit N Β· --tpslimit-burst N Caps API calls per second Drive, OneDrive, GoFile, anything returning 429s
--max-backlog N Checker β†’ transfer queue (default 10000) Raise on huge trees
--check-first Finishes all checks before transferring Accurate totals; slower start
--order-by size,mixed,75 Transfer ordering Mixed sets keep slots busy. size,descending = big files first

Bandwidth & budgets

Flag Effect
--bwlimit 20M Flat cap in bytes/s (20Mi for MiB)
--bwlimit "08:00,2M 23:00,off" Schedule: slow by day, full speed at night
--max-transfer 700G --cutoff-mode soft Stop starting new files at a byte budget
--max-duration 6h Stop after a time budget

Differential reports & run auditing

In modern rclone (1.7x), report flags are fully supported on copy and sync as well as check, providing a full audit trail without requiring a secondary inspection pass:

# Generate per-file outcome logs during live transfers:
rclone copy src: dst: \
    --combined combined.txt \
    --differ differ.txt \
    --missing-on-dst missing-dst.txt \
    --missing-on-src missing-src.txt \
    --match matched.txt \
    --error errors.txt
Flag Report contents
--combined FILE All evaluated files prefixed with status symbols below (- outputs to stdout)
--differ FILE Paths present on both sides but differing in size, modtime or hash
--missing-on-dst FILE Paths present on source but missing on destination
--missing-on-src FILE Paths present on destination but missing on source
--match FILE Paths identical on both source and destination
--error FILE Paths that encountered read, hash, or transfer failures

--combined line prefixes

Prefix Meaning
= Identical (matches on source and destination)
+ Only on source (missing on destination)
- Only on destination (missing on source)
* On both, but differs
! Error reading or hashing

Logging

Flag Level / effect
-v INFO β€” one line per file
-vv DEBUG β€” every API call. Send to --log-file
--log-file x.log Write log to file
--stats 30s --stats-one-line Compact progress every 30 s
--dump headers HTTP headers. ⚠️ Contains credentials β€” scrub before sharing

Exit codes

Code Meaning Code Meaning
0 Success 6 Less serious error
1 Uncategorized error 7 Fatal error
2 Usage error 8 --max-transfer reached
3 Directory not found 9 Nothing transferred (with --error-on-no-transfer)
4 File not found 10 --max-duration reached
5 Temporary error

6. Scenario profiles

Each profile lists the data path, the real bottleneck, peak RAM, and a starting command. Tune from there.

Profile Route Data path
6.1 S3 β†’ S3, same account πŸ–₯️ Server-side
6.2 S3 β†’ S3, cross-provider πŸ’» Client-side
6.3 S3 β†’ Google Drive πŸ’» Client-side
6.4 Google Drive β†’ S3 πŸ’» Client-side
6.5 Local HDD β†’ S3 πŸ’» Client-side
6.6 Drive β†’ Drive πŸ–₯️ Server-side
6.7 NVMe / 10GbE β†’ S3 πŸ’» Client-side
6.8 TorBox T3 β†’ R2 / Drive / GoFile πŸ’» Client-side

6.1 S3 β†’ S3, same account

Data path Bottleneck Peak RAM
πŸ–₯️ Server-side (CopyObject / UploadPartCopy) Provider request rate Negligible

Applies to AWS S3, and to R2 within one account. Not across providers.

rclone copy aws:source-bucket aws:dest-bucket \
    --transfers 64 --checkers 64 \
    --fast-list --s3-no-check-bucket \
    --log-file s3_server_copy.log --log-level INFO -P
  • Scale: start at 64; raise toward 128 only while the log stays clean.
  • Cross-account: credentials need read on the source and write on the destination.

6.2 S3 β†’ S3, cross-provider

Data path Bottleneck Peak RAM
πŸ’» Client-side Your uplink + RAM β‰ˆ 16 Γ— (256 + 32) MB β‰ˆ 4.6 GB
rclone copy s3-aws:src-bucket r2:dst-bucket \
    --transfers 16 --checkers 32 \
    --fast-list \
    --s3-chunk-size 64M --s3-upload-concurrency 4 \
    --buffer-size 32M --max-buffer-memory 4G --use-mmap \
    --s3-no-check-bucket \
    --retries 5 --low-level-retries 10 \
    --stats 10s --stats-one-line -P
  • Safety ceiling: --max-buffer-memory 4G prevents out-of-memory crashes if concurrency surges.
  • Scale: raise --s3-upload-concurrency to 8 only with RAM to spare.
  • Hashes differ across providers? Add --size-only.
  • Stream resets / "connection reset"? Add --s3-disable-http2 β€” a workaround for a specific provider, not a default.

Google Drive limits

Important

Every Drive route (6.3, 6.4, 6.6, 6.8) is bound by these:

  1. β‰ˆ 750 GB/day of uploads per account.
  2. A few new files per second.
  3. The shared default rclone OAuth client is heavily throttled β€” create your own Client ID and Secret in Google Cloud Console.

6.3 S3 β†’ Google Drive

Data path Bottleneck Peak RAM (chunks)
πŸ’» Client-side Drive API rate + daily cap transfers Γ— drive-chunk-size = 512 MB
rclone copy s3:prod-backups gdrive:ArchivedBackups \
    --transfers 4 --checkers 8 \
    --tpslimit 8 --tpslimit-burst 2 \
    --drive-chunk-size 128M --drive-upload-cutoff 128M \
    --drive-stop-on-upload-limit \
    --max-transfer 700G --cutoff-mode soft \
    --buffer-size 64M --fast-list \
    --log-file s3_to_gdrive.log --log-level NOTICE -P
  • Why 700G, not 750G: soft cutoff lets in-flight files finish, so it can overshoot by a few large files. 700G leaves margin.

6.4 Google Drive β†’ S3

Data path Bottleneck Peak RAM
πŸ’» Client-side Drive API rate β‰ˆ 8 Γ— (256 + 32) MB β‰ˆ 2.3 GB
rclone copy gdrive:CompanyFiles s3:cold-archive/gdrive \
    --transfers 8 --checkers 16 \
    --tpslimit 10 \
    --s3-chunk-size 64M --s3-upload-concurrency 4 \
    --buffer-size 32M --fast-list \
    --drive-export-formats docx,xlsx,pptx \
    --log-file gdrive_to_s3.log -P
  • Google Docs/Sheets/Slides: --drive-export-formats converts them; --drive-skip-gdocs skips them. Pick one β€” skipping makes export formats moot.
  • cannotDownloadAbusiveFile on files you own: add --drive-acknowledge-abuse.

Daily-cap runner (resumes next day)

rclone copy SRC DST --max-transfer 700G --cutoff-mode soft --drive-stop-on-upload-limit ...
rc=$?
[ $rc -eq 8 ] && echo "Daily cap reached, will resume tomorrow" && exit 0
exit $rc

Exit code 8 = --max-transfer reached, treated as success so the scheduler retries tomorrow.


6.5 Local HDD β†’ S3

Data path Bottleneck Peak RAM
πŸ’» Client-side Disk seeks β€” spinning disks slow down when reads compete β‰ˆ 2 Γ— (256 + 64) MB β‰ˆ 0.6 GB
rclone sync /mnt/storage_hdd/media s3:my-cold-bucket/media \
    --transfers 2 --checkers 4 \
    --s3-chunk-size 64M --s3-upload-concurrency 4 \
    --buffer-size 64M --use-mmap \
    --size-only \
    --s3-storage-class STANDARD_IA \
    --backup-dir s3:my-cold-bucket/deleted-$(date +%F) \
    --log-file hdd_sync.log --log-level INFO -P
  • --transfers 2 keeps reads mostly sequential. On a slow uplink raise to 3–4 β€” the network may be the real limit.
  • --size-only avoids hashing whole disks. For bit-rot protection use --checksum (slower).
  • --backup-dir must be on the same remote and outside the destination path.

Warning

STANDARD_IA bills a 30-day minimum and a 128 KB minimum object size. Don't use it for many tiny or short-lived files.


6.6 Drive β†’ Drive

Data path Bottleneck Peak RAM
πŸ–₯️ Server-side Drive daily cap (still applies server-side) Negligible
rclone copy drive-src:Folder drive-dst:Folder \
    --drive-server-side-across-configs \
    --transfers 8 --checkers 16 \
    --tpslimit 8 --fast-list \
    --max-transfer 700G --cutoff-mode soft \
    -v -P
  • Access: the destination account must be able to read the source, or both sit in the same Shared Drive.

6.7 NVMe / 10GbE β†’ S3

Data path Bottleneck Peak RAM
πŸ’» Client-side RAM 32 Γ— (1024 + 64) MB β‰ˆ 35 GB
rclone copy /mnt/nvme/datasets s3:big-data-bucket/datasets \
    --transfers 32 --checkers 64 \
    --s3-chunk-size 128M --s3-upload-concurrency 8 \
    --buffer-size 64M --use-mmap \
    --fast-list --s3-no-check-bucket \
    --log-level NOTICE -P
  • Too much RAM? Lower --s3-upload-concurrency to 4 (β‰ˆ 18 GB), or cap with --max-buffer-memory.

Caution

Don't combine --fast-list with --no-traverse β€” they conflict. Use --fast-list for a big mirror; --no-traverse only for a few files going into a huge bucket.


6.8 TorBox T3 β†’ R2 / Drive / GoFile

T3 is TorBox's read-only S3-compatible service at https://t3.nexus. Access Key = TorBox Auth ID Β· Secret = API key Β· v2 signatures. Remote config: section 3.

T3 behavior What to do
Buckets are tags. torbox holds untagged files; each tag is its own bucket List them with rclone lsd torbox:
Listings refresh every 15 min, can't be forced Missing a new file? Rerun later
Cloudflare caching can serve stale listings Inconsistent listings? Skip --fast-list on the first pass
Read-only Use copy. move fails (can't delete source); sync toward T3 is pointless
Client-side Run it on a VPS

T3 β†’ R2

Peak RAM Compare Verify
8 Γ— (256 + 32) MB β‰ˆ 2.3 GB --size-only (T3 ETags won't match R2 hashes) rclone check torbox:torbox/2017 r2:misc --size-only --one-way
rclone copy torbox:torbox/2017/ r2:misc \
    --transfers 8 --checkers 16 \
    --s3-chunk-size 64M --s3-upload-concurrency 4 \
    --buffer-size 32M \
    --size-only \
    --retries 5 --low-level-retries 20 --retries-sleep 10s \
    --stats 10s --stats-one-line \
    --log-file t3_r2.log --log-level NOTICE -P
  • Scale: TorBox has no published connection limits. Start at 8; on 429s or resets drop to 4 and add --tpslimit 10.

T3 β†’ Google Drive

rclone copy torbox:torbox/path gdrive:TorBox \
    --transfers 4 --checkers 8 \
    --tpslimit 8 --tpslimit-burst 2 \
    --drive-chunk-size 128M --drive-upload-cutoff 128M \
    --drive-stop-on-upload-limit \
    --max-transfer 700G --cutoff-mode soft \
    --buffer-size 64M --size-only \
    --retries 5 --low-level-retries 20 \
    --log-file t3_gdrive.log --log-level NOTICE -P
  • Use your own OAuth client (Drive limits).
  • Lots of small files? Drop to 2–3 transfers.

T3 β†’ GoFile

Modern rclone (1.7x) provides a native, first-class gofile backend. Setup in rclone.conf:

[gofile]
type = gofile
access_token = YOUR_API_TOKEN
# Optional: restrict to a specific directory ID
# root_folder_id = <folder_id>
rclone copy torbox:torbox/path gofile:folder \
    --transfers 2 --checkers 4 --tpslimit 2 \
    --buffer-size 32M --size-only \
    --retries 8 --low-level-retries 20 --retries-sleep 15s \
    --log-file t3_gofile.log --log-level NOTICE -P
  • Backend options: list_chunk defaults to 1000 items per call.
  • Rate limiting: GoFile enforces strict concurrent upload throttling. Keep --transfers 2 and --tpslimit 2 to avoid HTTP 429 timeouts.

T3 β†’ local disk

Large files can download in parallel with --multi-thread-streams 8.


7. VFS mount recipes

Note

Linux prerequisites: install FUSE. For --allow-other, uncomment user_allow_other in /etc/fuse.conf.

--vfs-cache-mode at a glance

Mode Caches Use for
off Nothing β€” pure streaming Simple reads. Writes and random seeks often fail
minimal Only files opened for both reading and writing Rarely the right choice
writes Files opened for writing Uploads, light disk use
full Reads and writes, in blocks Apps that seek or read/write. Most compatible; uses local disk

A read-only streaming mount can run with less than full.

Media server β€” Plex / Jellyfin / Emby

rclone mount gdrive:Media /mnt/media \
    --allow-other --read-only \
    --dir-cache-time 72h --poll-interval 15s \
    --vfs-cache-mode full \
    --vfs-cache-max-size 50G --vfs-cache-max-age 24h \
    --vfs-cache-min-free-space 10G \
    --vfs-read-ahead 128M \
    --vfs-read-chunk-size 32M --vfs-read-chunk-size-limit 2G \
    --buffer-size 64M \
    --vfs-refresh --vfs-fast-fingerprint \
    --log-level INFO --log-file /var/log/rclone_plex.log
  • --vfs-refresh: Pre-warms the entire directory hierarchy in the background upon startup, eliminating initial navigation freezes in Plex/Jellyfin.
  • --vfs-fast-fingerprint: Accelerates cache validation by bypassing redundant file hashing.
  • --poll-interval: Only applies to backends with server change notifications (Google Drive yes, S3 no).

Warning

In Plex, disable "Scan my library automatically" and deep media analysis. Mass scanning against Drive is a common cause of API bans.

Interactive read/write (Object Store / S3)

rclone mount s3:company-assets /mnt/assets \
    --allow-other \
    --vfs-cache-mode full \
    --vfs-cache-max-size 100G --vfs-cache-max-age 48h \
    --vfs-cache-min-free-space 15G \
    --vfs-write-back 5s \
    --dir-cache-time 10m --attr-timeout 10m \
    --vfs-read-chunk-streams 4 --vfs-read-chunk-size 16M \
    --no-modtime \
    --write-back-cache \
    --vfs-refresh \
    --buffer-size 32M
  • --vfs-read-chunk-streams 4: Reads 4 chunks concurrently, maximizing throughput on high-latency cloud connections.
  • --no-modtime: Slashes S3 API costs and latency by eliminating extra HEAD transactions for object timestamps.
  • --write-back-cache: Enables OS kernel write buffering (Linux/macOS) for smoother interactive editing.

Modern VFS Performance Flags in 1.7x

Flag Purpose Recommended setting
--vfs-refresh Recursively refreshes directory cache in the background on mount startup Add to all long-lived mounts
--vfs-fast-fingerprint Uses size and modtime to validate cached files without hashing Standard with --vfs-cache-mode full
--vfs-read-chunk-streams N Concurrently downloads N fixed-size chunks (when > 0) 4–16 on S3, R2, or high-latency WAN links
--vfs-cache-min-free-space SIZE Hard floor on host drive free space; evicts cached files before disk fills 10G–20G
--no-modtime Β· --use-server-modtime Avoids expensive S3 metadata requests per object Use on S3/Swift mounts to cut API bills
--write-back-cache Enables kernel writeback cache on Linux/macOS Interactive file shares / desktop mounts

8. Automation

Safe sync script

sync_job.sh β€” locked against overlapping runs, backs up deletions, verifies, then cleans up.

#!/usr/bin/env bash
set -Eeuo pipefail

LOCK_FILE="${XDG_RUNTIME_DIR:-/tmp}/rclone_backup.lock"   # /var/run needs root
LOG_DIR="/var/log/rclone"
DATE=$(date +%F_%H-%M-%S)
LOG_FILE="${LOG_DIR}/sync_${DATE}.log"

SOURCE_PATH="/mnt/data/critical"
DEST_PATH="s3:corporate-backup-vault/critical"
BACKUP_DIR="s3:corporate-backup-vault/archive_${DATE}"

mkdir -p "${LOG_DIR}"
exec 200>"${LOCK_FILE}"
flock -n 200 || { echo "Another run is active. Exiting."; exit 1; }
trap 'echo "[$(date +%T)] FAILED at line $LINENO" | tee -a "${LOG_FILE}"' ERR

echo "[${DATE}] Starting sync..." | tee -a "${LOG_FILE}"

rclone sync "${SOURCE_PATH}" "${DEST_PATH}" \
    --backup-dir "${BACKUP_DIR}" \
    --transfers 8 --checkers 16 --fast-list --use-mmap \
    --s3-chunk-size 64M --s3-upload-concurrency 4 --buffer-size 32M \
    --max-buffer-memory 2G --s3-no-check-bucket \
    --combined "${LOG_DIR}/combined_${DATE}.txt" \
    --retries 3 --low-level-retries 10 \
    --stats 30s --stats-one-line \
    --log-file "${LOG_FILE}" --log-level INFO

echo "[$(date +%T)] Sync done. Verifying..." | tee -a "${LOG_FILE}"

# Local -> S3: rclone stores an MD5 as object metadata on upload, so a hash check
# usually works. Use --size-only for a quicker pass, or --download as a last resort.
rclone check "${SOURCE_PATH}" "${DEST_PATH}" --one-way \
    --log-file "${LOG_FILE}" --log-level NOTICE

# Remove stale incomplete multipart uploads (S3)
rclone cleanup "${DEST_PATH}"

echo "[$(date +%T)] Finished successfully." | tee -a "${LOG_FILE}"

Tip

Ping a healthcheck URL (Healthchecks.io, Uptime Kuma) on success β€” curl -fsS https://.../ping β€” so silent failures get noticed.

Systemd mount service

/etc/systemd/system/rclone-mount.service

[Unit]
Description=Rclone VFS Mount for S3 Assets
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
User=ubuntu
Group=ubuntu
ExecStart=/usr/bin/rclone mount s3:company-assets /mnt/assets \
    --config=/home/ubuntu/.config/rclone/rclone.conf \
    --allow-other \
    --vfs-cache-mode full --vfs-cache-max-size 50G --vfs-cache-min-free-space 10G \
    --vfs-refresh --vfs-fast-fingerprint \
    --dir-cache-time 30m \
    --log-level INFO --log-file=/var/log/rclone-mount.log
ExecStop=/bin/fusermount3 -uz /mnt/assets
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

On older systems use fusermount instead of fusermount3.

Systemd timer for the sync job

/etc/systemd/system/rclone-sync.service/etc/systemd/system/rclone-sync.timer
[Unit]
Description=Rclone backup sync

[Service]
Type=oneshot
User=ubuntu
ExecStart=/usr/local/bin/sync_job.sh
[Unit]
Description=Nightly rclone sync

[Timer]
OnCalendar=*-*-* 02:30:00
Persistent=true
RandomizedDelaySec=10m

[Install]
WantedBy=timers.target

Enable both:

sudo systemctl daemon-reload
sudo systemctl enable --now rclone-mount.service rclone-sync.timer
systemctl list-timers | grep rclone

9. Verification & troubleshooting

Verifying a transfer

Command Checks Speed
rclone check SRC DST --one-way Size + hash, if available ●●○
rclone check SRC DST --size-only --one-way Size only β€” when hashes aren't comparable ●●●
rclone check SRC DST --download --one-way Reads both sides. Definitive ●○○
rclone check SRC DST --combined report.txt Full per-file report (prefixes) ●●○
rclone check SRC DST --match matched.txt --differ diffs.txt Separates matching and differing paths into clean lists ●●○
rclone copy SRC DST --combined audit.txt In-flight audit log directly generated during transfer pass ●●●

Common problems

Symptom Likely cause β†’ fix
SignatureDoesNotMatch / 403 on custom S3 Wrong signature version or endpoint, missing force_path_style, or clock skew β†’ sync with NTP
429, SlowDown, 503 Too aggressive β†’ lower --transfers, add --tpslimit
userRateLimitExceeded (Drive) Shared OAuth client β†’ use your own, lower --tpslimit
Upload limit / quota 403 (Drive) 750 GB/day reached β†’ --drive-stop-on-upload-limit, resume tomorrow
Out of memory β†’ Re-run the memory formula; lower concurrency, chunk size or transfers
too many parts / EntityTooLarge Chunk size too small β†’ raise --s3-chunk-size
Empty listing / exit 3 Wrong bucket or path β†’ check with rclone lsd remote:
Files re-copied every run Hashes/modtimes don't match across providers β†’ --size-only
corrupted on transfer: hashes differ Provider hash mismatch β†’ retry; --ignore-checksum only as last resort, then verify
Duplicate names on Drive β†’ rclone dedupe
Stale T3 listings 15-min refresh + Cloudflare cache β†’ wait and rerun
Job died on SSH drop β†’ run in tmux, screen or systemd

Important

rclone does not resume partial uploads. An interrupted large file restarts from zero on the next run; already-completed files are skipped.


10. Decision matrix

If you're doing… Path Starting flags Profile
S3 β†’ S3, same provider & account πŸ–₯️ Server --transfers 64 --checkers 64 --fast-list --s3-no-check-bucket 6.1
S3 β†’ S3, cross-provider (e.g. AWS β†’ R2) πŸ’» Client β€” do the RAM math --transfers 16 --s3-chunk-size 64M --s3-upload-concurrency 4 --max-buffer-memory 4G, + --size-only if hashes differ 6.2
TorBox T3 β†’ R2 πŸ’» Read-only source, copy only --transfers 8 --size-only 6.8
TorBox T3 β†’ Drive πŸ’» Read-only source, copy only --transfers 4 --tpslimit 8 --size-only 6.8
TorBox T3 β†’ GoFile πŸ’» Read-only source, copy only --transfers 2 --tpslimit 2 --size-only 6.8
Anything β†’ Google Drive πŸ’» Guard API rate + daily cap --transfers 4 --tpslimit 8 --drive-chunk-size 128M --max-transfer 700G --drive-stop-on-upload-limit 6.3
Mechanical HDD β†’ cloud πŸ’» Avoid seek thrashing --transfers 2 --checkers 4 --size-only --buffer-size 64M 6.5
NVMe / 10GbE β†’ cloud πŸ’» Big chunks, budget RAM --transfers 32 --checkers 64 --s3-chunk-size 128M --s3-upload-concurrency 8 --max-buffer-memory 8G 6.7
Using sync instead of copy πŸ”΄ --dry-run first --backup-dir remote:bucket/deleted-$(date +%F)/ Rules
Mounting a remote (General) VFS --vfs-cache-mode full --vfs-cache-max-size 50G --vfs-cache-min-free-space 10G --vfs-refresh --vfs-fast-fingerprint 7
Mounting S3 / R2 (High Latency) VFS --vfs-cache-mode full --vfs-read-chunk-streams 4 --no-modtime --write-back-cache 7

Appendix

Verified Build Features (v1.75+)

  • --combined family on copy / sync: Fully accepted on copy, sync, and check (--combined, --differ, --error, --missing-on-dst, --missing-on-src, --match).
  • Native GoFile backend options: type = gofile, access_token, root_folder_id, account_id, list_chunk (default 1000).
  • --max-buffer-memory: Fully supported global buffer cap (--max-buffer-memory SIZE, default off) to prevent RAM exhaustion across concurrent transfers.
  • Modern VFS mount enhancements: --vfs-refresh (background priming on mount), --vfs-fast-fingerprint (fast cache validation), --vfs-read-chunk-streams (concurrent chunk streaming for S3/WAN), --write-back-cache (kernel write buffer on Linux/macOS).
Changelog

V2.1 Updates (rclone 1.7x / v1.75+ settings):

  • Verified and documented --combined, --differ, --missing-on-dst, --missing-on-src, --match, and --error during live copy and sync passes.
  • Added --max-buffer-memory to tuning profiles and memory formulas to prevent out-of-memory spikes.
  • Expanded VFS recipes with --vfs-refresh, --vfs-fast-fingerprint, --vfs-read-chunk-streams, --no-modtime, and --write-back-cache.
  • Added verified native gofile and custom OAuth gdrive backend configurations.
  • Upgraded sync_job.sh and rclone-mount.service with modern buffer caps, cache safety floors, and live audit logging.

V2.0 Overhauls (Fixed from V1):

Wrong or misleading statements fixed

Topic Correction
config show / config dump dump is JSON; config redacted is the share-safe one
rclone du Doesn't exist β€” it's ncdu
rclone check --checksum Not how check works
Multi-thread cutoff Default is 256Mi, not 250Mi
--use-mmap About releasing memory back to the OS, not paging
--vfs-cache-mode minimal Was described wrongly
--multi-thread-streams Mostly for downloads to local disk

Contradictory flag combos fixed

  • --fast-list with --no-traverse
  • --drive-skip-gdocs with --drive-export-formats

Overstatements softened: "always use --fast-list" and "always use --vfs-cache-mode full".

Script fixes: the "checksum validation" step actually used --size-only; the lock file path needed root.

Added: compare-mode guidance, filtering and ordering, bandwidth schedules, exit codes, a quota-aware Drive loop, a systemd timer, a troubleshooting table, security notes, and the TorBox T3 scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment