Console9

Rsync vs SCP: which to use for recurring transfers

Compare Rsync and SCP for file transfer speed, delta encoding, resume capability, and incremental backup to decide which tool fits your use case.

Rsync and SCP (Secure Copy Protocol) both transfer files over SSH, but they differ in how they handle repeated transfers, bandwidth efficiency, and interrupted connections.

What Rsync Does Differently from SCP

Rsync transfers only the bytes that changed between the source and destination files. It uses a delta-transfer algorithm that computes rolling checksums on both ends and sends only the differing blocks. A 10 MB file with a one-line change may transfer only a few kilobytes on subsequent runs.

SCP copies the entire file from source to destination on every transfer, regardless of how much data changed. SCP reads the source file, transfers it over the SSH connection, and writes it at the destination as a linear byte-for-byte copy.

How Rsync's Delta-Transfer Algorithm Works

Rsync splits files into fixed-size blocks on both the source and destination sides. It computes a rolling checksum and a strong MD5 (or xxHash) checksum for each block on the destination. The source side compares its blocks against these checksums and transmits only the blocks that differ. This delta encoding approach reduces bandwidth consumption by orders of magnitude for large files with small changes.

SCP has no equivalent mechanism. SCP transfers the full contents of every file on every invocation, making it substantially slower for repeated transfers of large, infrequently changing datasets. SCP performs well for one-time transfers of small files where the overhead of checksum computation would exceed the transfer cost.

Transfer Speed: Rsync vs SCP

Rsync performs faster than SCP on subsequent transfers because it skips unchanged files and transmits only the changed bytes of modified files. The initial transfer speed of Rsync is comparable to SCP because both tools must send all data on the first run.

SCP may outperform Rsync on the initial transfer of a single file because SCP does not compute checksums before sending. The overhead of Rsync's checksum computation is negligible for large directories but measurable for individual small files.

Rsync supports compression during transfer with the -z flag, which further reduces bandwidth usage on slow or congested network connections. SCP does not offer built-in compression.

Resume and Partial Transfer: Rsync vs SCP

Rsync resumes interrupted transfers using the --partial flag (or -P which combines --partial and --progress). Rsync keeps the partially transferred file on the destination and continues from the point where the connection dropped. This makes Rsync suitable for transferring large files over unreliable network connections.

SCP restarts the entire file transfer from the beginning when the connection drops. SCP does not support partial file retention or transfer resumption. A failed SCP transfer of a 50 GB file requires re-transferring all 50 GB.

Incremental Backup: Rsync vs SCP

Rsync supports incremental backup strategies using the --link-dest flag. Rsync hard-links unchanged files to a reference directory (the previous backup) and copies only the changed files. This creates space-efficient daily snapshots where each backup appears as a complete copy but shares storage for unchanged files.

SCP provides no mechanism for incremental backups. SCP copies all files on every run without comparing against a previous state. Automating backups with SCP requires external scripts to track which files changed.

Rsync integrates with cron for automated, recurring backup schedules. See How to Schedule Rsync via Cron Jobfor setup instructions.

Feature Comparison: Rsync vs SCP

FeatureRsyncSCP
Delta transferRsync transfers only changed bytes using rolling checksums and block-level delta encoding.SCP copies the entire file on every transfer regardless of changes.
Resume interrupted transferRsync keeps partial files and resumes with --partial or -P.SCP restarts the full transfer from the beginning.
CompressionRsync compresses data during transfer with the -z flag.SCP does not support built-in transfer compression.
Directory synchronizationRsync mirrors directories and deletes extra files on the destination with --delete.SCP copies directories recursively but does not synchronize or remove extra files.
Preserve metadataRsync preserves permissions, timestamps, symlinks, ownership, and ACLs with -a, -A, -X.SCP preserves timestamps and permissions with -p.
Exclude filesRsync supports --exclude and --include patterns, plus --filter rules.SCP has no file exclusion mechanism.
Bandwidth limitingRsync throttles transfer speed with --bwlimit.SCP limits bandwidth with -l (in Kbit/s).
Incremental backupsRsync creates space-efficient snapshots using --link-dest with hard links.SCP has no incremental backup support.
ProtocolRsync uses SSH by default; also supports its own daemon protocol on port 873.SCP uses SSH exclusively. The SCP protocol is deprecated; modern scp commands use SFTP internally.
Initial transfer speedRsync computes checksums before transferring, adding minor overhead on first run.SCP sends data immediately without checksum overhead.

When to Use Rsync vs When to Use SCP

Use Rsync when:

  • The transfer recurs on a schedule (daily backups, regular deployments).
  • The files are large and change infrequently (database dumps, log archives, disk images).
  • The network connection is slow or unreliable and transfers need to resume.
  • The destination must mirror the source with exact file deletions.
  • Bandwidth is limited and compression or delta transfer reduces costs.

Use SCP when:

  • The transfer is a one-time copy of a small file or directory.
  • The source and destination have no prior copy to compare against.
  • The command needs to be as short and simple as possible for a quick ad-hoc transfer.

For most recurring file transfer and backup tasks, Rsync is the better tool. SCP remains useful for quick, ad-hoc transfers where delta computation overhead is unnecessary.

For practical Rsync setup instructions, see How to Copy Files with Rsyncand How to Run Rsync Through SSH Tunnel.