Check, Hash, and Dry Run
Data transfer is only half the job. Verification is what makes backup operations trustworthy.
Learning Focus
Learn a repeatable validation workflow: preview -> execute -> verify -> archive evidence (logs + check output).
Validation Workflow
flowchart LR
PLAN[Dry Run] --> EXEC[Execute Transfer]
EXEC --> CHECK[Run rclone check]
CHECK --> LOG[Store Logs + Exit Status]
Dry Run First
rclone sync /srv/data s3-prod:backup/data --dry-run --log-level INFO
note
Dry-run shows intended changes but does not prove correctness. Verification (check) is a separate step.
Integrity Commands
| Command | Purpose |
|---|---|
rclone check A B | Compare source vs destination |
rclone md5sum remote:path | Generate MD5 list (backend-dependent) |
rclone sha1sum remote:path | Generate SHA1 list (backend-dependent) |
rclone size remote:path | Audit object count and total bytes |
Checks: What They Really Mean
| Pattern | Meaning | Use when |
|---|---|---|
check SRC DST --one-way | Validate destination has everything from source | Backups where source is authoritative |
check SRC DST | Bidirectional mismatch report | Comparing two replicas |
check ... --size-only | Fast compare without hashes | Backend lacks reliable hashes |
Practical Example
verify-transfer.sh
rclone sync /srv/data s3-prod:backup/data --log-file /var/log/rclone-sync.log
rclone check /srv/data s3-prod:backup/data --one-way --checkers 16 --log-file /var/log/rclone-check.log
note
Some providers do not expose the same hash algorithms for all objects. In those cases, use size/time validation plus spot checks.
Capture Evidence (Combined Output)
When you want an audit trail you can attach to tickets/incidents:
rclone check /srv/data s3-prod:backup/data --one-way --combined /var/log/rclone-check.combined.txt
Common Pitfalls
| Pitfall | Impact | Prevention |
|---|---|---|
Skipping dry-run on sync | Unexpected deletes | Always preview and inspect log output |
| Trusting only transfer exit code | Drift remains undetected | Add rclone check after critical jobs |
| Assuming hash support is universal | False mismatch expectations | Confirm provider hash capability |
Hands-On Practice
- Run a
sync --dry-run. - Run a real
copyto a lab prefix. - Run
check --one-way.
practice-validation.sh
rclone sync /srv/data s3-prod:labs/validate --dry-run -vv
rclone copy /srv/data s3-prod:labs/validate --progress
rclone check /srv/data s3-prod:labs/validate --one-way
Quick Reference
rclone sync SRC DST --dry-run
rclone check SRC DST --one-way
rclone size DST