How to Show Only rsync Transfer Summary While Suppressing File Listing Output


2 views

When dealing with large directory structures containing thousands of files, the default rsync output can become overwhelming. The "incremental file list" display floods your terminal while providing little value during ongoing transfers.

The solution combines two essential flags:

rsync -a --stats --info=progress0 source/ destination/

This command structure gives you:

  • -a: Archive mode (preserves permissions, timestamps)
  • --stats: Final transfer statistics
  • --info=progress0: Global progress without per-file output

For different use cases, consider these variations:

Basic summary only:

rsync -a --quiet --stats source/ destination/

With compression:

rsync -az --stats --info=progress0 source/ destination/

The statistics block provides valuable insights:

Number of files: 1,234
Number of files transferred: 456
Total file size: 5.67GB
Total transferred file size: 1.23GB
Literal data: 1.23GB
Matched data: 0
File list size: 0
File list generation time: 0.001 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 1.24GB
Total bytes received: 2.34MB

For scripting purposes, use the --no-human-readable flag:

rsync -a --stats --no-human-readable source/ destination/

While suppressing output, you might want to preserve error messages:

rsync -a --stats --info=progress0 source/ destination/ 2>rsync_errors.log

When backing up large directories with rsync, the default output displays every file being processed in the "incremental file list" section. For massive directory structures, this creates unnecessary terminal noise and makes it difficult to quickly assess the backup status.

Many users first try the -q (quiet) flag:

rsync -avzq /source/ user@remote:/destination/

This completely silences output - including the valuable summary statistics we need. Other approaches like redirecting stderr also eliminate too much information.

The correct approach combines three flags:

rsync -av --info=progress0 --stats /source/ user@remote:/destination/

Let's break this down:

  • -a: Archive mode (preserves permissions, etc.)
  • -v: Still needed for the summary output
  • --info=progress0: Suppresses individual file progress
  • --stats: Ensures summary displays

For scripted environments where you need both detailed logs and clean console output:

rsync -av --log-file=rsync.log --stats /source/ /destination/ | grep -A10 "Number of files"

This writes full details to rsync.log while showing only the summary statistics in the console.

Here's how I implement this in my production backup script:

#!/bin/bash
LOG="/var/log/backups/$(date +%Y-%m-%d).log"
rsync -az --info=progress0 --stats \
    --exclude='*.tmp' \
    --exclude='.cache/' \
    /home/ /backup/nas/home/ > "$LOG"
    
# Extract just the summary
tail -n 15 "$LOG" | grep -E "Number of|Total|Literal|transferred"

When working with remote systems, you can add SSH compression while maintaining clean output:

rsync -az -e "ssh -C" --info=progress0 --stats \
    user@remote:/source/ /local/destination/