Skip to main content

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.

Quick Summary

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

ModeFlagWhat It Verifies
Two-way(default)Files at both source and dest match; reports files missing on either side
One-way--one-wayEvery source file exists and matches at destination; ignores dest extras
Size only--size-onlyOnly compare file sizes (faster, less thorough)
Download--downloadDownload and hash-compare files (for backends without server-side hashing)

Key Flags

FlagDescription
--one-wayOnly check that source files exist at destination
--size-onlyCompare sizes only (skip hash check)
--downloadDownload files to compute hashes locally
--combined FILEWrite combined report (match/mismatch/missing) to file
--missing-on-src FILEWrite files missing on source to file
--missing-on-dst FILEWrite files missing on destination to file
--differ FILEWrite differing files to file
--match FILEWrite matching files to file
--log-file PATHWrite 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

verify-deploy.sh
#!/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

PitfallConsequencePrevention
Skipping check after syncUndetected data corruption or missing filesAlways verify critical transfers
Using default two-way on append-only backupReports destination extras as errorsUse --one-way for backup verification
Slow hash-check on large datasetsHours of runtimeUse --size-only for quick checks, full hash for important data
Backend without server-side hashingCheck silently skips hash comparisonUse --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: =, *, +, -)