Master efficient file transfers and backups with the powerful rsync command in Linux.
This delta-transfer tool only sends changes, saving time and bandwidth.
Perfect for local copies, remote transfers, and automated backups. Learn essential flags like -a , -v , --delete , and --progress to optimize your file synchronization workflows!
Learn:
✅ Step-by-Step Guide:
1. Basic Local File Copy:
rsync -av /source/directory/ /destination/directory/
-a : Preserves file attributes (permissions, timestamps).
-v : Enables verbose output.
Trailing slashes (/) ensure directory contents are copied.
2. Sync with Deletion:
rsync -av --delete /source/directory/ /destination/directory/
Ensures destination matches source exactly (removes extra files).
3. Remote File Transfer:
rsync -avz /local/directory/ user@remote:/remote/directory/
-z : Compresses data during transfer for better performance.
4. Dry Run:
rsync -av --dry-run /source/directory/ /destination/directory/
Simulates the operation without making changes.
5. Exclude Files:
rsync -av --exclude='*.tmp' /source/directory/ /destination/directory/
Excludes temporary files from the transfer.
6. Show Progress:
rsync -av --progress /source/directory/ /destination/directory/
Shows real-time transfer statistics for each file.
✅ Why Use rsync?
⚡ Delta Transfer: Only sends changed parts of files.
🔒 Preserves Attributes: Maintains permissions, timestamps, etc.
🌐 Remote Capabilities: Works seamlessly with SSH.
🛠️ Flexible Options: Exclude, resume, compress, and more.
✅ Pro Tips:
Use -P (same as --partial --progress ) for large file transfers.
Always test with --dry-run before executing destructive syncs.
Combine with cron for automated backup schedules.
You can find a comprehensive PDF tutorial and examples for the rsync command at this GitLab link: https://gitlab.com/hatem-badawi/linux....
Hit subscribe for more Linux command tutorials and like if this helped.
Let us know: What's your most-used rsync option?
👉 Watch now and master efficient file synchronization!
#LinuxTips #Rsync #FileTransfer #Backups #CommandLine
(Short, clear, and packed with practical knowledge!)