rsync — Fast, Resumable File Transfers¶
Problem¶
Copying large files or directory trees between drives or servers is slow, fragile, and unresumable with cp. A dropped connection or a single error means starting over. You also want to skip files that already exist at the destination without re-copying them.
Solution¶
rsync is a file synchronization tool that only transfers what has changed, preserves metadata, and can resume interrupted transfers. It works locally and over SSH.
Installation (Fedora)¶
Basic Local Copy¶
-a— archive mode: preserves permissions, timestamps, symlinks, ownership-v— verbose: shows what's being transferred
Trailing slash on source matters:
- /source/ — copy the contents of source into destination
- /source — copy the source directory itself into destination
Resume an Interrupted Transfer¶
--partial— keeps partially transferred files so they can be resumed--progress— shows per-file progress and speed
Skip Already-Transferred Files¶
Useful when restarting a migration — skips anything already at the destination regardless of timestamp comparison.
Dry Run First¶
Always preview what rsync will do before committing:
No files are moved. Output shows exactly what would happen.
Transfer Over SSH¶
Or with a non-standard port:
Exclude Patterns¶
Real-World Use¶
Migrating ~286 files from /majorRAID to /majorstorage during a RAID dissolution project:
rsync -av --partial --progress --ignore-existing \
/majorRAID/ /majorstorage/ \
2>&1 | tee /root/raid_migrate.log
Run inside a tmux or screen session so it survives SSH disconnects:
tmux new-session -d -s rsync-migrate \
"rsync -av --partial --progress /majorRAID/ /majorstorage/ | tee /root/raid_migrate.log"