
> rsync command generator — dry-run first, delete with a net▋
Most rsync generators assemble flags and wish you luck. This one dry-runs by default and refuses a bare --delete: the backup net makes every mirror reversible.
mrsaynothing· 16 October 2026· 5 min read
What separates a sync from a wipe? Usually one flag. Type rsync -a --delete /mnt/empty-usb/ /home/you/ and rsync will faithfully make your destination match your source — all of it, including the part where your home directory is now empty. Every generator I could find on page one happily wires that flag behind a checkbox; one of them even labels its output "AI-generated and not yet checked for validity," which is a bold thing to print above a delete command. That is the lie this tool refuses: that assembling rsync syntax and understanding rsync semantics are the same job. The rsync command generator is live — it builds the command, names the traps in plain words, and treats --delete like the loaded gun it is.
Why does --delete deserve a warning?
Because rsync's contract is make the destination match the source, and --delete extends that contract to removals. The man page is blunt about it: the flag means "delete extraneous files from the destination dir." Extraneous means anything the source doesn't have — including things that are only missing because you pointed at the wrong source, mounted the wrong USB stick, or typo'd a path. The generator's job is to make that consequence visible before the command runs, not after:
| Flag | What it does | What it does when you're wrong |
|---|---|---|
--delete |
Destination files missing from source get removed | Wrong source path → destination files "extraneous" → gone |
src/ vs src |
Trailing slash copies the contents; no slash copies the directory itself | One character, entirely different destination layout |
-a |
Archive: recursive + permissions, times, owners, symlinks | Skipped → a "backup" that silently isn't one |
--partial |
Keep half-transferred files on interruption | Flaky link → restart the whole transfer from zero |
The trailing-slash row is the classic. rsync's own documentation says a trailing slash on the source "changes this behavior to avoid creating an extra directory at the destination" — which is documentation-speak for: src/ pours the contents into the destination, src creates dest/src and pours them in there. Two characters. The generator shows which sentence applies as you type, because the trailing slash is also the only rsync flag that has eaten more home directories than rm -rf ever did.
How do you arm a delete safely?
You don't remove the safety — you add a net. The generator's arm flow has two steps: the command ships with --dry-run and you read what would happen; only then do you flip the arm switch for the real run. And the moment --delete is involved, the tool refuses to emit a bare delete. It appends the net:
rsync -a --delete \
--backup --backup-dir=/mnt/backup/_rsync_backup_$(date +%F) \
/mnt/usb/ /mnt/backup/
With --backup --backup-dir set, rsync doesn't destroy the files it removes or overwrites — it moves them aside into the dated folder first. The mirror still ends up exact. The day you notice the wrong source was mounted, your files are sitting in _rsync_backup_2026-10-16/ instead of being a lesson. Reversibility is the difference between a mirror and a memory.
Yes:
rsync -a --delete --backup --backup-dir=DEST/_rsync_backup_$(date +%F) SRC/ DEST/. The two net flags move every deleted or overwritten file into a dated folder instead of erasing it, so the mirror stays exact and the deletions stay reversible. Dry-run first with-n, read the list, then arm it.
verify: man rsync → --backup reads "make a backup of every file installed" · the --backup-dir rows land in DEST/_rsync_backup_<date>/, not the void
Which flags does the generator wire?
The set that covers nearly every real transfer, grouped the way you actually decide about them:
- Paths — local or remote on either side (
user@host:/path), with the SSH port wired through-e "ssh -p 2222"when it isn't 22. - Direction — the trailing-slash toggle, with the contents-vs-directory sentence printed live.
- Filters —
--excludepatterns with presets for the usual suspects:.git,node_modules, caches, logs. - Manners —
-zcompression,--bwlimitso the 3am backup stops saturating the household,-Pfor progress and resumability,-cwhen mtime lies. - The arm lane — dry-run default, explicit arm step, net auto-attached to any
--delete.
Output is one paste-ready line (or a backslashed multi-line, your terminal's choice), plus an embeddable snippet if you want the builder on your own page. Like the GGUF VRAM calculator, it's a single HTML file doing arithmetic in your browser — nothing you type leaves the page, because a tool about safe copies shouldn't phone home.
Where this sits in the toolbox
The generator composes the command; the sibling posts hold the theory. Rsync vs scp covers why rsync's delta transfer beats a dumb copy and when scp is still fine. Cron vs systemd timers is the scheduling half — a generator-built rsync command drops into a timer, and the journal side of knowing whether it ran is in the journalctl cheat sheet.
A dry-run you skip is a delete you didn't mean.
The tool is at github.com/mrsaynothing/rsync-builder — MIT, one file, no build step. If the arm flow ever feels like it's nagging, that's the feature working; and if you can name a flag combination the net doesn't cover, open an issue — the dangerous corners are exactly the ones worth mapping.
$ Related entries
GGUF vs safetensors — the runtime decides, not the format
The same model in three containers: 397 MB of Q4_K_M GGUF, 1.20 GB of BF16 GGUF, 1.50 GB of BF16 safetensors. The bytes are the record's honest numbers — the runtime decides.
2026-10-14 · 6 min read

git merge vs rebase — decide in 10 seconds
Merge or rebase, one question decides: did the commit leave your machine? The decision table, the fast-forward case, and the reflog fix when a rebase goes wrong.
2026-10-05 · 7 min read

Fatal: Not a Git Repository? The 60-Second Fix
The four real causes of fatal: not a git repository, ranked plus the one command that tells you which one you have before you touch anything.
2026-09-28 · 7 min read

Git Undo Generator: the Exact Command for Your Mess
Answer three questions — pushed or not, keep or discard, shared or solo — and the git undo generator hands you the exact reset, revert or reflog command.
2026-09-25 · 4 min read
