rsync Command Builder
Generate rsync commands visually. Toggle flags, add excludes, set SSH port — copy the result.
Client-side only — nothing leaves your browser
Trailing slash copies contents. No slash copies the directory itself.
Remote format: user@host:/absolute/path
One pattern per line. Each becomes a separate --exclude flag. Glob syntax: *, **, ?.
What does the rsync command do?
rsync (short for "remote sync") is the standard Unix utility for copying and synchronizing files — between two local paths, between a local machine and a remote server over SSH, or between two remote servers. Its defining feature is the delta-transfer algorithm: rsync only sends the bytes that have changed since the last run, so re-syncing a large tree is dramatically faster than scp, cp, or a fresh copy. The trade-off is that rsync's behavior is governed almost entirely by flags, and getting one wrong (a missing trailing slash, an unguarded --delete) can wipe data on the destination. This builder generates correct commands for the common cases — push, pull, mirror, and incremental snapshot — so you don't have to memorize the syntax.
Anatomy of an rsync Command
Every rsync command has the same four-part structure. Source and destination are always the last two arguments — everything before them is options:
| Part | Purpose |
|---|---|
| rsync | The binary. Must be installed on both sides for SSH transfers. |
| -avzP | Short flags. Stack them in any order; -a is archive mode, -v verbose, -z compress, -P progress+partial. |
| --exclude=... | Long flags with values. Skip files matching the pattern. Can be repeated. |
| /src/ | Source path. Local path or user@host:/path. |
| user@host:/dst/ | Destination. Same syntax as source — one of the two can be remote, but not both unless you use --rsh chaining. |
Common rsync Command Patterns
These are the rsync commands that show up most often in scripts, Stack Overflow answers, and backup playbooks:
Push a local folder to a remote server
rsync -avzP /home/me/projects/ user@host:/backups/projects/Pull a remote folder down to your laptop
rsync -avzP user@host:/var/www/ ./site-backup/Sync between two servers over SSH on a custom port
rsync -avzP -e 'ssh -p 2222' /src/ user@host:/dst/Mirror with --delete (preview first with -n)
rsync -avn --delete /src/ /backup/Snapshot-style backup hardlinked against yesterday
rsync -av --link-dest=/mnt/backup/yesterday/ /home/me/ /mnt/backup/today/Bandwidth-capped transfer (10 MB/s)
rsync -avz --bwlimit=10M /src/ user@host:/dst/Exclude multiple patterns
rsync -av --exclude=node_modules --exclude='*.log' /src/ /dst/rsync Flags Cheat Sheet
| Flag | Long form | What it does |
|---|---|---|
| -a | --archive | Recursive copy that preserves permissions, times, owner, group, symlinks, and devices. The base flag for almost every rsync command. |
| -v | --verbose | Print each filename as it transfers. Use -vv or -vvv for more detail. |
| -z | --compress | Compress data in transit. Useful over SSH on slower networks; skip on a fast LAN or for already-compressed files. |
| -P | --partial --progress | Show a per-file progress bar and keep partial files on interrupt so transfers can resume. |
| -h | --human-readable | Print sizes as 1.2M instead of 1234567. |
| -n | --dry-run | Show what would happen without actually copying or deleting anything. Always use before --delete. |
| --delete | Make the destination an exact mirror — files removed from source get removed from destination. Destructive. | |
| --exclude=PAT | Skip files matching PAT (glob). Repeatable. Common: --exclude=node_modules, --exclude='*.log'. | |
| --bwlimit=N | Cap socket I/O bandwidth (e.g. --bwlimit=10M for 10 MB/s). | |
| --link-dest=DIR | Hardlink unchanged files against DIR. The standard pattern for space-efficient incremental backups. | |
| -e | --rsh=CMD | Pick the remote shell. Use this to set a custom SSH port: -e 'ssh -p 2222'. |
Frequently Asked Questions
What is the rsync command in Linux?
What does -avz mean in the rsync command?
How do I run rsync over SSH with a custom port?
How do I exclude multiple directories with rsync?
Why does the trailing slash on the rsync source matter?
Related Tools
rsync Flag Explainer
Paste any rsync command and instantly see what every flag does, with risky-flag warnings.
Setup Script Generator
Generate a bash setup script for a fresh Ubuntu or Debian VPS. Hardens SSH, configures UFW, fail2ban, Docker, and unattended upgrades.
Firewall Rule Generator
Cross-platform firewall rule builder (UFW, iptables, nftables, Windows, AWS, GCP). Also explains existing rules.
iptables to nftables
Convert iptables rules to nftables. Translates chains, NAT, conntrack, and common matchers.
Docker Compose Generator
Build docker-compose.yml visually. Add services, volumes, networks, env vars — with live YAML and lint warnings.
Need to manage SSH connections?
SSH Workbench lets you connect, browse files, and manage servers visually.
Try SSH Workbench Free