AI Tools Free

Rsync Command Generator

Configure your source and destination paths, SSH port, exclude globs, and sync mode to generate production-ready `rsync` commands with a trailing-slash behavior audit and `--dry-run` companion command.

Free to useNo sign-upRuns in your browser
Enter your details

Enter the inputs, then select Generate rsync Command.

Trailing slash copies directory contents; omitting trailing slash copies the directory itself.

Target local folder or remote SSH destination.

Adds -e 'ssh -p PORT' when different from 22.

Comma-separated globs converted into --exclude='pattern' flags.

Select standard additive sync, exact mirror (--delete), checksum mode (-c), or dry-run (-n).

Your result
Enter your details

Result will appear here

How the Rsync Command Generator Works

The generator assembles your flags, builds `--exclude` arguments, adds `-e 'ssh -p ...'` when a custom SSH port is used, and explains how your source path's trailing slash affects the destination directory.

rsync -avzP [-e 'ssh -p <port>'] [--exclude='<glob>'] '<src>' '<dest>'

Outputs both the live execution command and a safe `--dry-run` preview command.

Rsync Command Generator workflow overview
Workflow overview for Rsync Command Generator.

Rsync Flags & Trailing-Slash Reference Table

Key `rsync` options and path rules for local backups and remote SSH deployments.

Flag / SyntaxExpanded MeaningTransfer BehaviorSafety & Best Practice
-a (--archive)-rlptgoDPreserves permissions, timestamps, symlinks, and directory recursion.Standard baseline flag for almost all Linux/macOS sync jobs.
-z (--compress)Zlib transit compressionCompresses data blocks over SSH network links.Use for remote SSH transfers; omit on local disk-to-disk copies.
-P--partial --progressKeeps partially transferred large files and shows live progress bars.Allows interrupted multi-GB transfers to resume cleanly.
src/ vs srcTrailing slash rule'src/' copies contents of src; 'src' copies the directory folder itself.Verify trailing slash before running with --delete.
--deleteMirror deletionDeletes destination files that no longer exist in source.Always test with -n (--dry-run) first.

How to Generate Your rsync Command

Set up your transfer parameters in three steps.

Enter source and destination paths (check trailing slash)

Input local or `user@host:/path/` endpoints.

Rsync Command Generator step 1: Enter source and destination paths (check trailing slash)
Step 1 workflow overview for Rsync Command Generator.

Configure SSH port and comma-separated --exclude patterns

Set a custom SSH port if needed and list folders like `.git, node_modules` to exclude.

Rsync Command Generator step 2: Configure SSH port and comma-separated --exclude patterns
Step 2 workflow overview for Rsync Command Generator.

Choose Additive, Mirror (--delete), Checksum, or Dry-Run mode

Click Generate rsync Command to get the command, dry-run preview, and trailing-slash diagnosis.

Rsync Command Generator step 3: Choose Additive, Mirror (--delete), Checksum, or Dry-Run mode
Step 3 workflow overview for Rsync Command Generator.

Worked rsync Deployment & Backup Examples

See how common web deployment and server backup commands are constructed.

Static site deployment over SSH (`./dist/` to remote `/var/www/app/`)

Generates: rsync -avzP --exclude='.git' --exclude='node_modules' './dist/' 'deploy@203.0.113.10:/var/www/app/'

Rsync Command Generator example 1: Static site deployment over SSH (`./dist/` to remote `/var/www/app/`)
Worked example 1 for Rsync Command Generator.

Custom SSH port 2222 mirror with --delete

Generates: rsync -avzP --delete -e 'ssh -p 2222' './dist/' 'deploy@203.0.113.10:/var/www/app/' plus a mandatory -n dry-run command.

Rsync Command Generator example 2: Custom SSH port 2222 mirror with --delete
Worked example 2 for Rsync Command Generator.

Checksum-verified backup (-c)

Adds '-c' (--checksum) so rsync compares 128-bit file checksums rather than relying solely on modification time and size.

Rsync Command Generator example 3: Checksum-verified backup (-c)
Worked example 3 for Rsync Command Generator.

Understanding the Trailing-Slash Diagnostic

The output panel explicitly states whether your source path copies directory contents or creates a nested folder.

If your source ends with `/` (e.g. `./dist/`), files inside `dist` land directly inside the destination folder.

If your source does not end with `/` (e.g. `./dist`), rsync creates `<destination>/dist/`.

How to interpret Rsync Command Generator results
Result interpretation guide for Rsync Command Generator.

Frequently Asked Questions About rsync

Answers about using Rsync Command Generator and understanding its results.

What does the trailing slash on the rsync source path do?

In rsync, 'rsync -av ./dist/ /var/www/app/' (with a trailing slash on './dist/') copies the contents inside 'dist' directly into '/var/www/app/'. Omitting the trailing slash ('./dist') creates a nested '/var/www/app/dist/' subdirectory.

What do the flags -avzP mean in rsync?

'-a' (archive) equals '-rlptgoD' (recursive, symlinks, permissions, timestamps, group, owner, devices); '-v' enables verbose output; '-z' compresses file data during network transit; and '-P' combines '--partial' (resumable transfers) with '--progress'.

How do I specify a non-standard SSH port with rsync?

Pass the '-e' remote-shell option: "rsync -avzP -e 'ssh -p 2222' ./dist/ user@host:/var/www/".

Why should I run rsync with --dry-run (-n) before using --delete?

The '--delete' flag permanently removes any files in the destination directory that do not exist in the source. Running with '--dry-run' (or '-n') first prints every file that would be deleted without modifying disk state.

Try your own values

Choose another tool for your next calculation, conversion, or text task.

Generate rsync Command