QA
Intermediate LevelLinux Commands & SysAdmin

How does rsync efficiently sync files locally and over SSH using delta transfer algorithms?

❓ Interview Prompt: Explain rsync, delta transfer algorithm, archiving flags (-avz), SSH transport (-e ssh), --delete flag, and dry-run (--dry-run).

'rsync' (Remote Sync) efficiently synchronizes files locally or over SSH by using a delta transfer algorithm that transmits ONLY the modified file diffs rather than re-copying entire files!

Key Flags:

•
'-a' (Archive mode): Preserves permissions, symlinks, timestamps, and ownership recursively.
•
'-v': Verbose | '-z': Compress data during transfer.
•
'--delete': Deletes files in destination that no longer exist in source (mirroring).
•
'--dry-run': Simulates sync execution without altering files.

Code Implementation Example

bash
# Dry-run simulation of rsync directory backup
rsync -avz --dry-run /var/www/app/ deploy@backup-server:/backups/app/

# Mirror directory over SSH deleting stale destination files
rsync -avz --delete -e ssh /var/www/app/ deploy@192.168.1.50:/backups/app/
💡Synchronizing directories over SSH using rsync delta compression.
🎯 Interview Key Takeaway

Use rsync -avz --dry-run to test file sync operations safely before executing live transfers.

#rsync#File Sync#Delta Transfer#Backup#Intermediate
Back to all Linux Commands & SysAdmin Questions→

More Linux Commands & SysAdmin Interview Questions

Beginner LevelLinux Commands & SysAdmin

How do Linux File Permissions (chmod, chown, chgrp) work in Octal and Symbolic notation?

Beginner LevelLinux Commands & SysAdmin

What is the Linux Filesystem Hierarchy Standard (/bin, /etc, /var, /usr, /opt, /tmp)?

Beginner LevelLinux Commands & SysAdmin

What are File Descriptors (0=stdin, 1=stdout, 2=stderr) and Redirection (>, >>, 2>&1)?