rsync Command Builder
Build an rsync command with the right archive, delete, exclude and bandwidth options, and understand the trailing slash rule that decides where files actually land.
Last reviewed by the Radiatus Cloud team
Want this automated for your stack?
We build CI/CD, Kubernetes & IaC pipelines that scale.
The trailing slash is the whole game
rsync treats a source path ending in a slash as "the contents of this directory" and one without as "this directory itself". Copying /data to /backup produces /backup/data, while copying /data/ to /backup produces /backup containing what was in data. Getting it backwards either nests a directory one level too deep or scatters files into the parent, and combined with the delete option it can remove things you meant to keep. This single character causes more rsync incidents than every other option together.
Dry run before delete, always
The delete option removes files at the destination that no longer exist at the source, which is what makes a mirror a mirror and what makes a mistyped source path destructive. Running with the dry run flag first prints exactly what would be transferred and deleted without touching anything. On any command containing delete, this is not caution, it is the procedure: a source path that fails to match anything combined with delete empties the destination.
Archive mode and what it misses
The archive flag is a shorthand for recursion plus preserving symlinks, permissions, times, group and owner. It does not include hard links, access control lists or extended attributes, so a backup of a system that uses any of those needs the extra flags explicitly. It also does not imply compression, which helps over a slow network and wastes CPU on a fast local one or on data that is already compressed.
Related tools
- CI/CD Security Gap Analyzer — Checklist based analyzer for CI/CD pipeline security gaps.
- Docker Security Scanner — A new tool extracted from the codebase.
- Terraform Scanner — A new tool extracted from the codebase.
- SQL Formatter — Format and indent SQL queries for readability. Handles joins, subqueries and CTEs, supports common dialects, and runs entirely in your browser.
Frequently Asked Questions
What does the trailing slash on the source do?
A source ending in a slash copies the directory contents; one without copies the directory itself. /data/ to /backup puts the files directly in /backup, while /data to /backup creates /backup/data. This is the most common rsync mistake and it is destructive when combined with delete.
When should I use --delete?
When you want an exact mirror rather than an additive copy. Always run with --dry-run first, because a source path that matches nothing combined with delete will empty the destination. It is not a backup option; it removes history.
Does --archive preserve everything?
No. It covers recursion, symlinks, permissions, times, group and owner. Hard links need -H, access control lists need -A and extended attributes need -X. A full system backup needs all three added explicitly.
Should I use compression?
Over a slow or metered network, yes. On a fast local link or a LAN it usually costs more CPU than it saves time, and it is counterproductive for data that is already compressed such as media files or archives.
How do I resume an interrupted transfer?
--partial keeps partly transferred files so the next run continues rather than restarting, and --append-verify resumes large files by appending after verifying the existing portion. --progress shows per file progress, and --info=progress2 shows overall progress instead.
Privacy & Security
Everything runs in your browser; nothing is uploaded.
How to Use
Set source and destination, choose your options, and copy the rsync command with each flag explained.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.