Title: rsync Command Builder | Visual rsync Command Generator
Open Graph Title: rsync Command Builder | Visual rsync Command Generator
Description: Build rsync commands visually. Toggle flags, set source and destination, add SSH port and excludes, and copy the full command. Covers backup, mirror, dry-run, and incremental snapshots.
Open Graph Description: Build rsync commands visually. Toggle flags, set source and destination, add SSH port and excludes, and copy the full command. Covers backup, mirror, dry-run, and incremental snapshots.
Opengraph URL: https://sshworkbench.com/tools/rsync-command-builder
Domain: sshworkbench.com
IPv4 address: 172.67.157.29
{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"What is the rsync command in Linux?","acceptedAnswer":{"@type":"Answer","text":"rsync is a Linux command-line utility that copies and synchronizes files between two locations, locally or across machines over SSH. It's preinstalled on most modern Linux distributions and macOS, and is the standard tool for backups, server-to-server file sync, and mirroring directories. The basic syntax is rsync [options] source destination, where either source or destination can be local (a path like /var/www/) or remote (user@host:/path). What sets rsync apart from cp or scp is the delta-transfer algorithm: on subsequent runs, it only sends the parts of files that have changed, which makes large recurring transfers dramatically faster."}},{"@type":"Question","name":"What does -avz mean in the rsync command?","acceptedAnswer":{"@type":"Answer","text":"-avz is the most common rsync flag combination, especially for transfers over SSH. It stacks three short flags: -a (archive mode, a recursive copy that preserves permissions, modification times, owners, groups, symlinks, and devices), -v (verbose, listing each file as it transfers), and -z (compress data in transit). You'll often see -avzP, which adds --partial and --progress so the transfer is resumable and shows a live progress bar. Skip -z on a fast local network or when copying already-compressed files (videos, JPEGs, .gz), since the CPU cost of compressing incompressible data slows the transfer down."}},{"@type":"Question","name":"How do I run rsync over SSH with a custom port?","acceptedAnswer":{"@type":"Answer","text":"Pass a custom SSH command to rsync with the -e flag: rsync -avzP -e 'ssh -p 2222' /src/ user@host:/dst/. The quotes are required so the shell passes 'ssh -p 2222' as a single argument. You can also chain additional SSH options the same way, such as a specific identity file: -e 'ssh -p 2222 -i ~/.ssh/backup_key'. Note that rsync's own --port flag is only for the rsync daemon protocol (port 873), not for SSH. For SSH on a non-standard port you always use -e."}},{"@type":"Question","name":"How do I exclude multiple directories with rsync?","acceptedAnswer":{"@type":"Answer","text":"Repeat the --exclude flag once per pattern: rsync -av --exclude=node_modules --exclude=.git --exclude='*.log' /src/ /dst/. Patterns use glob syntax, and patterns that contain shell metacharacters (* ? [ ]) should be single-quoted so the local shell doesn't expand them first. For a long list, put the patterns in a file (one per line) and use --exclude-from=ignore.txt instead, which is easier to maintain and reuse across scripts. Order matters when you combine --include and --exclude: rsync evaluates rules top-to-bottom and the first match wins."}},{"@type":"Question","name":"Why does the trailing slash on the rsync source matter?","acceptedAnswer":{"@type":"Answer","text":"A trailing slash on the source changes what gets copied. rsync -av /src/ /dst/ copies the contents of /src into /dst, so you end up with /dst/file1, /dst/file2. rsync -av /src /dst/ (no trailing slash on source) copies the directory itself into /dst, giving you /dst/src/file1, /dst/src/file2. The trailing slash on the destination doesn't change behavior. Only the source side matters. This is the single most common rsync footgun, especially when combined with --delete: a misplaced slash can dump files in the wrong place or empty the wrong directory. Always test with -n (--dry-run) first."}}]}
| twitter:card | summary_large_image |
| og:type | website |
| og:site_name | SSH Workbench |
Links:
| Server | cloudflare |
| Content-Type | text/html; charset=utf-8 |
| X-Powered-By | Next.js |
| Via | 1.1 Caddy |
| Cache-Control | public, s-maxage=86400, stale-while-revalidate=604800 |
Viewport: width=device-width
Robots: index,follow