Skip to main content

rclone Sha1sum

rclone sha1sum prints SHA-1 hashes for every file at the given path. Some backends (notably OneDrive) natively support SHA-1 instead of MD5 — use this command when SHA-1 is the available or preferred hash algorithm.

Quick Summary

Output format matches the standard sha1sum command. If your backend doesn't natively support SHA-1, use --download to compute hashes locally, or hashsum to choose a supported algorithm.

Basic Syntax

rclone sha1sum REMOTE:PATH [flags]
# Generate SHA-1 sums for all files
rclone sha1sum remote:my-bucket

# Save to file
rclone sha1sum remote:my-bucket > checksums.sha1

# Specific path
rclone sha1sum remote:my-bucket/documents

Output Format

da39a3ee5e6b4b0d3255bfef95601890afd80709  report.pdf
a94a8fe5ccb19ba61c4c0873d391e987982fbbd3 data.csv

Key Flags

FlagDescription
--downloadDownload files to compute hash locally
--include PATTERNOnly hash matching files
--exclude PATTERNSkip matching files

Practical Examples

Verify OneDrive Backup

# OneDrive natively supports SHA-1
rclone sha1sum onedrive:Backups > /tmp/remote-sha1.txt
rclone sha1sum /var/backups > /tmp/local-sha1.txt
diff /tmp/local-sha1.txt /tmp/remote-sha1.txt

Hash Specific Files

rclone sha1sum remote:backups --include "*.tar.gz"

Common Pitfalls

PitfallConsequencePrevention
Backend doesn't support SHA-1Empty hash outputUse hashsum with supported type or --download
Confusing SHA-1 with SHA-256Wrong hash comparisonVerify which hash type your backend supports

What's Next

Examples with Output

1. Hash a file on OneDrive

OneDrive uses SHA-1 natively — get the hash without downloading. Command:

rclone sha1sum onedrive:Docs/final.pdf

Output:

da39a3ee5e6b4b0d3255bfef95601890afd80709  final.pdf

2. Generate SHA-1 manifest for a bucket

Create a complete list of SHA-1 hashes for all files. Command:

rclone sha1sum remote:my-bucket

Output:

a94a8fe5ccb19ba61c4c0873d391e987982fbbd3  file1.txt
adc83b19e793491b1c6ea0fd8b46cd9f32e592fc file2.jpg

3. Compare remote SHA-1 with local

Verify that a download matches the remote OneDrive source perfectly. Command:

sha1sum local_file.zip && rclone sha1sum onedrive:local_file.zip

Output:

abc123def... local_file.zip
abc123def... local_file.zip

4. Hash only specific subdirectories

Deep-scan a specific part of your remote storage. Command:

rclone sha1sum remote:bucket/archives/2023

Output:

(List of hashes for files within the 2023 folder)

5. Force local computation

Compute hashes manually if the backend doesn't support them server-side. Command:

rclone sha1sum remote:s3-bucket --download

Output:

(Rclone downloads files to /tmp, hashes them, and prints results)