Build a safe rsync command, copy it, then run it
rsync is the standard tool for copying files between two places (a local folder, another folder, a remote server over SSH) and only transferring what actually changed. That makes it perfect for backups, website deploys, mirroring a NAS, sync between two machines. The catch: the command line has 50+ flags, the order matters, and a typo with `--delete` can wipe data you wanted to keep.
This builder gives you the full command in a live preview: pick a preset (deploy, backup, mirror), toggle the flags you want, fill in source and destination, and copy the result. It shows the trailing-slash gotcha as a visual diagram (`src/` versus `src` change what gets copied), warns you before you arm `--delete` without `--dry-run`, and lays out the command with line continuations so you can read it before pasting into a terminal.
Everything runs in your browser: nothing is sent anywhere, no SSH connection is made, the tool just builds text. Paste the result into your own shell when you are ready.
How to use it
- Pick a scenario at the top: local to local, local to remote (push over SSH), remote to local (pull), or remote to remote. The source and destination placeholders update so you know the format.
- Type the source (the folder you copy from) and the destination (where it lands). For remote paths use `user@host:/absolute/path`.
- Pay attention to the trailing slash on the source. With `/var/www/site/` you copy the contents of the folder. Without the slash (`/var/www/site`) you copy the folder itself as a subdirectory of the destination. The diagram on the right shows what happens in your current state.
- Pick a mode: Archive (preserve everything), Backup (keep old versions in a side folder), Mirror (make destination exactly equal to source, deletes extras), Deploy (compressed, mirrored, skip `.git`), or Custom to toggle flags yourself.
- Open Transfer options to add compression (`-z`, useful over SSH), progress (`--progress`), verbose levels, dry run (`-n`, recommended for the first run), or delete extras (`--delete`, dangerous).
- Add exclude patterns (one per line, e.g. `.git`, `node_modules`, `*.log`) and include patterns if you need rsync to keep specific files inside an otherwise excluded folder.
- For SSH targets fill in the port and identity file (private key) under SSH options. The builder wraps it in `-e "ssh -p N -i path/key"` for you.
- Copy the full command from the right panel and paste it into your terminal. Always run `--dry-run` first when destructive flags are on.
When this is useful
Eight scenarios where building the rsync command in advance saves you from a bad surprise:
- Deploying a website to a VPS. You changed a few files locally and you want them on the server. `rsync -avz --delete --exclude='.git' --exclude='node_modules' /local/site/ user@host:/var/www/site/`. Only changed files cross the wire, the destination ends up identical to your source, and your version control folders stay out of the upload.
- Nightly backup of a home folder to a NAS. Mount the NAS, then `rsync -avh --delete /home/me/ /mnt/nas/backup/me/`. After the first run (which copies everything) each later run takes seconds because only diffs move.
- Pulling a server log dump down for analysis. `rsync -avz --progress user@prod:/var/log/app/ ./logs/`. The `--progress` flag shows you a per-file ETA, useful when the dump is 5 GB.
- Moving photos off an SD card. `rsync -avh --progress /Volumes/SDCARD/DCIM/ ~/Pictures/2026/`. rsync verifies each file after copying, unlike a plain drag-and-drop in Finder which can silently truncate a file if the card is yanked early.
- Mirroring a production database dump between two servers. `rsync -avz --partial --append --bwlimit=5000 server-a:/dumps/ server-b:/dumps/`. The bandwidth limit keeps the transfer from saturating the office uplink. `--partial --append` lets you resume if the SSH connection drops halfway through a 50 GB dump.
- Syncing your dotfiles between laptop and desktop. `rsync -avh --exclude-from=excludes.txt ~/dotfiles/ desktop:~/dotfiles/`. Easier than git when you do not want a repository, faster than copying by hand.
- Cleaning a destination that drifted out of sync. The destination has files your source no longer has. `rsync -avn --delete /src/ /dest/` (note the `-n` for dry run) lists exactly what would be removed. Once it looks right, drop the `-n` and run for real.
- Migrating a server to new hardware. `rsync -avzAX --numeric-ids --delete /` from the old box to the new one (over SSH, as root, with care) preserves permissions, ACLs and extended attributes so the new server boots into the same state.