DevTools Logo

Rsync Command Builder

Rsync Command Builder

Assemble an rsync command step by step, with every flag explained before you copy it.

Runs in your browser

Choose source and destination paths, toggle a trailing slash to control whether the directory or its contents are copied, and select archive, compression, progress, checksum, delete and backup flags. Add include/exclude patterns, a custom SSH port or identity file, bandwidth and timeout limits. The command is assembled with POSIX single-quote escaping, and every flag is explained in a table alongside warnings for destructive combinations such as --delete and --delete-excluded. Presets cover deploy, backup, migration and dry-run-first workflows.

Try an example

Paths and transport

Flags

Filters and limits

Generated command

3 flags
rsync -a -v -n dist/ /var/www/app/

dist/ (contents) — With a trailing slash, rsync copies the contents of dist/ into /var/www/app/.

Flags used and why
FlagMeaningWhy here
-aArchive mode: recursive, links, permissions, times, group, owner and devices (-rlptgoD)Preserves metadata for backups and deploys.
-vVerbose outputShows which files are transferred.
-nDry run: perform a trial run with no changesPreview before a destructive sync.

Examples

Deploy preview

Input
dist/ → deploy@example.com:/var/www/app/, archive, verbose, delete, dry run, exclude .git and *.map
Output
rsync -a -v -n --delete --exclude .git --exclude '*.map' dist/ deploy@example.com:/var/www/app/

A dry run lists exactly what a mirroring deploy would change.

Custom SSH port

Input
remote host, port 2222, identity ~/.ssh/deploy
Output
-e 'ssh -p 2222 -i ~/.ssh/deploy'

Quoting the whole transport keeps the SSH options in a single rsync argument.

No trailing slash

Input
source dist (no slash), destination /var/www/app/
Output
creates /var/www/app/dist rather than replacing the contents of /var/www/app

The difference is the most common rsync mistake and is shown beside the command.

About this tool

Rsync Command Builder turns a guided set of choices into one shell-quoted rsync command. It covers the flags that matter in practice — archive mode, verbose output, compression, progress, deletion, dry runs, itemisation, checksums and backups — and explains each one next to the command.

The safety-critical details are explicit. A trailing-slash toggle states whether you copy a directory or its contents, --delete and --delete-excluded raise warnings, and remote destinations are assembled as user@host:path with an optional single-quoted SSH transport carrying port, identity and extra options. Exclude and include patterns are shell-quoted line by line.

Presets for deploy, backup, migrate and dry-run-first give a starting point; every field remains editable. Generation happens entirely in the browser, so paths and host names are never uploaded.

What this tool does not do

  • The builder emits a command; it never executes it or checks remote reachability.
  • Only a practical subset of rsync flags is exposed, not every option from the man page.
  • Shell quoting targets POSIX shells; Windows cmd.exe requires different quoting.
  • Pattern semantics depend on the rsync version and surrounding rules; test filters with a dry run.

How to use this tool

  1. Set source and destination

    Enter local paths, or switch on the remote destination to build user@host:path with a host, optional user, port and identity file.

  2. Choose the trailing slash

    With a slash you copy the contents of the source directory; without it you copy the directory itself into the destination.

  3. Select flags and filters

    Toggle archive, delete, dry-run and other flags, then list exclude or include patterns one per line.

  4. Check warnings and explanations

    The output panel explains every flag and calls out destructive combinations before you run anything.

  5. Copy the command

    Copy the markdown report or the command itself, then run the dry-run variant first when deletion is involved.

Use cases

Static-site deploys

Mirroring a build directory while excluding maps and VCS metadata.

Offsite backups

Archive-mode copies with backup directories and bandwidth limits.

Server migration

Checksum-verified initial copy with progress, no deletion.

Important flag groups

FlagEffect
-aArchive mode: recursive copy that preserves links, permissions, times, group and owner.
-n / --itemize-changesTrial run with a per-file change list — the safe way to preview --delete.
--deleteRemove destination files absent from the source; creates a true mirror.
--exclude / --includePattern filters; include rules are evaluated before exclude rules.
-e 'ssh -p … -i …'Custom SSH transport as one quoted argument.

Arguments are quoted with POSIX single quotes, including escaping embedded apostrophes.

Common mistakes

Mistake:Running --delete without a dry run first.

Fix:Keep -n enabled until the itemised list is reviewed; add --backup for recoverability.

Mistake:Forgetting the trailing slash on the source.

Fix:Use the toggle and read the explanation: without a slash rsync creates a nested directory.

Mistake:Passing multiple SSH options as separate shell words after -e.

Fix:The builder emits one quoted transport string so rsync receives a single argument.

Mistake:Expecting --delete-excluded to protect excluded files.

Fix:It does the opposite: excluded files on the destination are deleted too.

Frequently asked questions

What does the trailing slash mean in rsync?

A trailing slash on the source means “copy the contents of this directory into the destination”. Without it, rsync copies the directory itself, creating a nested folder. The builder states this beside the command because getting it wrong is a common cause of misplaced files.

Is --delete dangerous?

It makes the destination a mirror: any file not present in the source is removed. That is useful for deploys but destructive if the source is incomplete or paths are wrong. Run with -n and --itemize-changes first, and consider --backup so overwritten files are recoverable.

What is inside -a (archive)?

Archive mode combines -r (recursive), -l (links), -p (permissions), -t (times), -g (group), -o (owner) and -D (devices/specials). It preserves metadata rather than just copying bytes.

How do I use a custom SSH port?

Switch on the remote destination, enter the host and set the port. The builder emits -e 'ssh -p 2222' (adding -i for an identity file) as a single quoted argument so rsync passes it to ssh correctly.

How do I exclude files and folders?

Type one pattern per line in the Exclude patterns field, for example .git or *.map. Each becomes a shell-quoted --exclude argument. Include rules are emitted before exclude rules, matching rsync's evaluation order.

Does the tool run the command?

No. It generates text locally and explains it. Nothing is executed and no path, host name or pattern is uploaded.

References & standards