Rsync Safe File Transfer and Backup Checklist
rsync is a powerful tool for copying files between folders or servers. It is useful for backups, migrations, staging copies and syncing website files, but it can also overwrite or delete data if used carelessly.
Core principle
rsync mirrors file state. Always understand source, destination and delete behavior before running it on production data.
Checklist
- Identify source path.
- Identify destination path.
- Confirm trailing slash behavior.
- Run dry-run before real sync.
- Avoid delete option until you understand impact.
- Preserve permissions and ownership when needed.
- Exclude cache, temporary files or backups if needed.
- Log the sync result.
- Verify destination files.
- Document the sync command.
Reusable lesson
rsync applies to WordPress migrations, backups, staging copies, config backups, media transfers, Docker bind mounts and disaster recovery.
When to Use This Checklist
Use this checklist when syncing website files, creating staging copies, moving media, backing up configs or migrating server data.
Required Tools
SSH access, rsync, source path, destination path, backup destination, enough disk space
Before You Start
Do not run rsync with --delete until you are completely sure the destination should mirror the source.
Structured Checklist Steps
- Confirm source.
- Confirm destination.
- Check trailing slash.
- Run dry-run.
- Avoid unsafe delete.
- Preserve permissions.
- Set excludes.
- Log result.
- Verify destination.
- Save command.
Verification Steps
- Dry-run output is reviewed.
- Destination path is correct.
- Important files are copied.
- Permissions are acceptable.
- No unexpected deletion occurs.
Rollback Plan
If rsync overwrites or deletes files unexpectedly, stop further syncs and restore from backup before running a corrected command.
Common Mistakes
- Mixing up source and destination.
- Misunderstanding trailing slash behavior.
- Using --delete blindly.
- No dry-run.
- Syncing cache or temporary files unnecessarily.
Related Commands
rsync -av --dry-run /var/www/example.com/ /backup/example.com/
rsync -av /var/www/example.com/ /backup/example.com/
rsync -av --exclude='cache/' /var/www/example.com/ /backup/example.com/
rsync -avz /var/www/example.com/ user@server:/backup/example.com/