rclone Check
rclone check compares files between source and destination to verify they match. It checks file sizes and hashes (when available) and reports any differences — without transferring or modifying anything.
Run check after every critical copy or sync operation to verify data integrity. It's a read-only command — it never modifies, deletes, or transfers files.
Basic Syntax
rclone check SOURCE DESTINATION [flags]
# Compare local directory against remote
rclone check /var/www/html remote:backups/www
# Compare two remotes
rclone check remoteA:data remoteB:data
# One-way check (only verify source files exist at destination)
rclone check /var/www/html remote:backups/www --one-way
Check Modes
| Mode | Flag | What It Verifies |
|---|---|---|
| Two-way | (default) | Files at both source and dest match; reports files missing on either side |
| One-way | --one-way | Every source file exists and matches at destination; ignores dest extras |
| Size only | --size-only | Only compare file sizes (faster, less thorough) |
| Download | --download | Download and hash-compare files (for backends without server-side hashing) |
Key Flags
| Flag | Description |
|---|---|
--one-way | Only check that source files exist at destination |
--size-only | Compare sizes only (skip hash check) |
--download | Download files to compute hashes locally |
--combined FILE | Write combined report (match/mismatch/missing) to file |
--missing-on-src FILE | Write files missing on source to file |
--missing-on-dst FILE | Write files missing on destination to file |
--differ FILE | Write differing files to file |
--match FILE | Write matching files to file |
--log-file PATH | Write log to file |
Practical Examples
Verify a Backup
# After copying website files, verify they match
rclone copy /var/www/html remote:backups/www --progress
rclone check /var/www/html remote:backups/www --one-way
Post-Sync Verification
# After syncing, verify both directions
rclone sync /srv/data remote:mirror --progress
rclone check /srv/data remote:mirror
Expected output on success:
2024/01/15 10:30:00 NOTICE: 1234 files matched
Expected output with differences:
2024/01/15 10:30:00 ERROR: file.txt: sizes differ
2024/01/15 10:30:00 ERROR: path/to/doc.pdf: not found on remote
2024/01/15 10:30:00 NOTICE: 1232 files matched
2024/01/15 10:30:00 NOTICE: 2 differences found
Generate a Detailed Report
# Write all results to separate files
rclone check /var/www remote:backups/www \
--combined /tmp/check-report.txt \
--missing-on-dst /tmp/missing-remote.txt \
--differ /tmp/different.txt
Report file format (combined):
= matching-file.txt
* differing-file.txt
+ only-on-source.txt
- only-on-destination.txt
Fast Size-Only Check
# Quick check — less thorough but much faster on large datasets
rclone check /srv/data remote:backups --size-only
Verify in CI/CD Pipeline
#!/bin/bash
rclone check /build/dist remote:cdn/site --one-way 2>&1 | tee /tmp/check.log
if grep -q "differences found" /tmp/check.log; then
echo "DEPLOY VERIFICATION FAILED"
exit 1
fi
echo "Deploy verified successfully"
Common Pitfalls
| Pitfall | Consequence | Prevention |
|---|---|---|
| Skipping check after sync | Undetected data corruption or missing files | Always verify critical transfers |
| Using default two-way on append-only backup | Reports destination extras as errors | Use --one-way for backup verification |
| Slow hash-check on large datasets | Hours of runtime | Use --size-only for quick checks, full hash for important data |
| Backend without server-side hashing | Check silently skips hash comparison | Use --download to force hash comparison |
What's Next
Examples with Output
1. One-way verification of a backup
Ensure every local file exists and matches on the remote. Command:
rclone check /local/path remote:path --one-way
Output:
2024/01/15 12:00:00 NOTICE: 1500 files matched
2. Check and log differences
Find exactly which files don't match. Command:
rclone check /local/path remote:path --differ diffs.txt
Output:
2024/01/15 12:00:00 NOTICE: 1498 files matched
2024/01/15 12:00:00 NOTICE: 2 differences found
Note: 'diffs.txt' will contain the paths of non-matching files.
3. Fast size-only check
Quickly verify integrity when hashes aren't supported. Command:
rclone check /local remote:backup --size-only
Output:
2024/01/15 12:00:00 NOTICE: 500 files matched
4. Full download verification
Verify by downloading (for backends without hashes). Command:
rclone check /local remote:unreliable --download
Output:
(Downloads each file and compares hash locally)
2024/01/15 12:10:00 NOTICE: 100 files matched
5. Generate detailed combined report
Create a single file showing all matched, missing, and changed files. Command:
rclone check /src remote:dest --combined report.txt
Output:
(report.txt created with status characters: =, *, +, -)