rsync Command Generator
Build rsync commands for local copies, backups and SSH transfers, with every flag explained.
The rsync command generator builds a ready-to-paste rsync command without making you second-guess the flags. Describe the copy in plain words: type a source and a destination, say whether either end is a remote box reached over SSH, then tick what you want, archive, verbose, compress, human-readable sizes, progress and resume, a dry run, an exclude pattern, or a full mirror with --delete. The command updates live and every flag is spelled out underneath, so you learn what each one does instead of pasting magic. Toggle --delete and a red warning appears, because that flag mirrors the destination and can remove files you meant to keep. Presets cover push, pull, mirror and resume, and everything runs locally in your browser.
100% in your browser. Nothing you type ever leaves this page.
rsync command generator
Need an rsync command and don't want to second-guess the flags? Type a source and a destination, say if either end lives on a remote box, tick what you want. You get a command you can paste straight into a terminal. Flip on --delete and a red warning shows up, because honestly that flag has eaten more than a few backups. The whole thing runs in your browser, nothing leaves the page.
What this rsync command generator does
rsync copies and syncs files, locally or over SSH, and it only moves what actually changed. So the second run is quick. The third is quicker. That's why it sits under so many backup scripts and deploy pipelines. The flags are another story. There are dozens, and a bad mix (looking at you, --delete) can wipe data you wanted to keep. Here you just describe the copy in plain words and the exact command falls out, every flag spelled out, with a loud warning before anything that bites.
The mental model isn't hard. rsync takes a source and a destination, then makes the destination match the source for whatever it copies. What trips people up is one character: the trailing slash. src/ copies the contents of src into the destination. Drop the slash and src copies the folder itself, so you end up with a directory nested inside a directory. A tiny thing that's bitten me more than once.
The flags that matter
- -a (archive) is the one you'll use nearly every time. It means recursive, and it preserves permissions, timestamps, symlinks, the ownership, all of it in one letter.
- -v (verbose) lists what moved. Pair it with -h so sizes show up as KB or MB instead of a wall of bytes.
- -z (compress) squeezes data on the wire. Great over a slow link. On a fast LAN or a local copy it just burns CPU for nothing, so skip it there.
- -P rolls
--partialand--progressinto one: a progress bar, plus it hangs onto half-finished files so a big interrupted transfer can pick up where it died. - --dry-run (-n) pretends. It lists what would change and touches nothing. I run it before any real sync I'm even slightly unsure about, and you probably should too.
- --delete wipes files on the destination that aren't in the source anymore, which is what makes it a true mirror. Useful. Also the flag most likely to ruin your afternoon.
Local, push and pull
Put a user@host: prefix on either side and rsync reaches for SSH on its own. No extra flag needed. A push sends local files up to a server: rsync -avz ./site/ user@web:/var/www/. A pull drags them back down: rsync -avz user@web:/var/www/ ./backup/. Running SSH on some other port? Tack on -e 'ssh -p 2222'. Encrypted, resumable, and it doesn't choke on a connection that drops halfway, which is why people lean on it for moving big datasets between machines.
Always dry-run before --delete
Here's the trap with --delete. Point the source at the wrong path, or slip in a trailing slash that quietly changes the layout, and rsync will do exactly what you told it: delete the destination files to match. It's not malicious. It's obedient, which is worse. So add --dry-run first, actually read the list of things it wants to remove, and only then run it for real. That's the whole reason this generator slaps a red warning on --delete and ships a dry-run preset.
Privacy and how this tool runs
JavaScript builds the command right here in your browser. Your paths and hostnames don't get sent anywhere, and nothing's logged. That matters on this page more than most, since half of what you type into it is real server names.
Frequently asked questions
What does rsync -avz mean?
Three flags bundled together. -a is archive mode, so it recurses and keeps permissions, timestamps, symlinks and ownership intact. -v just makes it talk, listing what it moved. -z compresses on the way across. You will see -avz everywhere for copying a directory tree, mostly because over a network it is the combo that just works.
Why does the trailing slash on the source matter?
A slash on the end means the stuff inside this folder. So rsync -a src/ dst/ drops the files from src straight into dst. Lose the slash and rsync -a src dst/ copies the folder itself, leaving you with dst/src/. One character. It is probably the single most common rsync mistake, and yeah, I have made it too.
How do I rsync over SSH to a custom port?
The -e option carries it: rsync -avz -e 'ssh -p 2222' src/ user@host:/dest/. Set a non-default port up top and the generator writes that for you. Honestly though, if you hit the same host a lot, I would just put the port in ~/.ssh/config once and drop -e from your commands forever.
What does --delete actually delete?
It removes anything on the destination that is not in the source, so the two end up as an exact mirror. The source is never touched, do not worry about that. The thing to fear is an empty or wrong source path, because rsync will happily mirror that emptiness right over your destination. Run --dry-run first and read the deletion list before you commit.
How do I resume an interrupted transfer?
Reach for -P, which is just --partial --progress in shorthand. The --partial half is the bit that matters: it keeps the chunk that already came through, so a re-run continues instead of starting the whole file from zero again. On a flaky connection with big files, this is the difference between annoying and unbearable.