CommandLinux / Mac

Hollow Sync

Sync Directories with Dry Run Preview

Synchronizes two directories using rsync with a preview mode that shows what would change without making modifications. Critical for verifying backup and deployment operations.

rsync -avhn --delete source/ destination/

Usage Notes

  • -a archive mode (preserves permissions, timestamps, symlinks)
  • -v verbose output
  • -h human-readable sizes
  • -n dry run (no changes made)
  • --delete removes files in destination not present in source
  • Remove -n to execute the actual sync
  • Trailing slash on source matters: source/ syncs contents, source syncs the folder itself

Warnings

The --delete flag permanently removes files from destination. Always run with -n first to preview changes.

Related Scroll Ideas

  • • Rsync over SSH to remote server
  • • Exclude patterns during sync
  • • Sync with bandwidth limiting