{"id":12325,"date":"2025-12-20T10:11:06","date_gmt":"2025-12-20T04:41:06","guid":{"rendered":"https:\/\/www.youstable.com\/blog\/?p=12325"},"modified":"2026-03-25T10:22:52","modified_gmt":"2026-03-25T04:52:52","slug":"rsync-command-in-linux","status":"publish","type":"post","link":"https:\/\/www.youstable.com\/blog\/rsync-command-in-linux","title":{"rendered":"Rsync Command in Linux: Complete User Guide 2026 (Examples + Tips)"},"content":{"rendered":"\n<p><strong>The rsync command in Linux is<\/strong> a fast, reliable file synchronization and backup utility that copies only changed data using a delta transfer algorithm. It preserves permissions, ownerships, timestamps, and supports compression, encryption over SSH, exclusions, and mirroring. Admins use rsync for local and remote backups, server migrations, and efficient website deployments.<\/p>\n\n\n\n<p>If you manage Linux servers or websites, mastering the rsync command in Linux is essential. In this user guide, you\u2019ll learn exactly how rsync works, how to install it, core options, real examples, performance tuning, and best practices for secure, incremental backups\u2014whether you\u2019re syncing locally or to a remote server over SSH.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"what-is-rsync-and-how-it-works\">What is rsync and How it Works?<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"2496\" height=\"1664\" src=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/image-19.png\" alt=\"What Is rsync and How It Works\" class=\"wp-image-12394\" srcset=\"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/image-19.png 2496w, https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/image-19-150x100.png 150w\" sizes=\"auto, (max-width: 2496px) 100vw, 2496px\" \/><\/figure>\n\n\n\n<p>rsync (remote sync) is a differential file copy tool. Instead of transferring entire files each time, rsync calculates differences and sends only changed blocks, dramatically reducing bandwidth and time. <\/p>\n\n\n\n<p>It supports local to local copies and local to remote (or remote to local) transfers <a href=\"https:\/\/www.youstable.com\/blog\/how-to-connect-to-server-via-ssh\/\">via SSH<\/a> or an rsync daemon, while preserving metadata and handling symbolic links, devices, and hard links.<\/p>\n\n\n\n<p><strong>Key capabilities:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Delta transfer algorithm copies only changes<\/li>\n\n\n\n<li>Preserves permissions, ownership, and timestamps<\/li>\n\n\n\n<li>Works locally or over SSH\/rsync daemon<\/li>\n\n\n\n<li>Supports exclude\/include patterns and filelists<\/li>\n\n\n\n<li>Mirroring and pruning with <code>--delete<\/code><\/li>\n\n\n\n<li>Compression (<code>-z<\/code>) and progress output (<code>-P<\/code>\/<code>--info=progress2<\/code>)<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"install-rsync-on-linux\">Install rsync on Linux<\/h2>\n\n\n\n<p>rsync is available in all major distributions. Use your package manager:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Debian\/Ubuntu\nsudo apt update &amp;&amp; sudo apt install rsync\n\n# RHEL\/CentOS\/Rocky\/Alma (RHEL 8+)\nsudo dnf install rsync\n\n# Fedora\nsudo dnf install rsync\n\n# Arch\/Manjaro\nsudo pacman -S rsync<\/code><\/pre>\n\n\n\n<p><strong>Verify installation:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync --version<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"basic-syntax-and-quick-start\">Basic Syntax and Quick Start<\/h2>\n\n\n\n<p><strong>rsync syntax is simple:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync &#91;OPTIONS] SOURCE DESTINATION<\/code><\/pre>\n\n\n\n<p><strong>Examples:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># 1) Local directory to directory\nrsync -av \/home\/user\/Documents\/ \/mnt\/backup\/Documents\/\n\n# 2) Local to remote over SSH (port 22 by default)\nrsync -av -e ssh \/var\/www\/ user@server:\/backups\/www\/\n\n# 3) Remote to local download\nrsync -av -e ssh user@server:\/var\/log\/ \/local\/logs\/<\/code><\/pre>\n\n\n\n<p><strong>For safety, do a dry run before executing:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av --dry-run --delete \/source\/ \/dest\/<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"most-used-rsync-options-explained\">Most Used rsync Options Explained<\/h2>\n\n\n\n<p><strong>Memorize these core flags to move fast and avoid mistakes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>-a<\/code> (archive): <\/strong>Recursively copy and preserve permissions, ownership, timestamps, symlinks, and more.<\/li>\n\n\n\n<li><strong><code>-v<\/code> (verbose):<\/strong> Show more output. Combine with <code>-a<\/code> as <code>-av<\/code>.<\/li>\n\n\n\n<li><strong><code>-z<\/code> (compress):<\/strong> Compress data during transfer, ideal for WAN links.<\/li>\n\n\n\n<li><strong><code>-P<\/code> (progress + partial):<\/strong> Show progress and keep partial files to resume faster.<\/li>\n\n\n\n<li><strong><code>--info=progress2<\/code>:<\/strong> Single, cumulative progress bar for large runs.<\/li>\n\n\n\n<li><strong><code>-e ssh<\/code>: <\/strong>Use SSH as the transport for encryption and authentication.<\/li>\n\n\n\n<li><strong><code>--delete<\/code>:<\/strong> Remove files at destination that no longer exist at source (mirror).<\/li>\n\n\n\n<li><strong><code>--exclude<\/code>\/<code>--include<\/code>:<\/strong> Skip or include specific files\/patterns.<\/li>\n\n\n\n<li><strong><code>--exclude-from=FILE<\/code>:<\/strong> Load exclusion patterns from a file.<\/li>\n\n\n\n<li><strong><code>--bwlimit=KBPS<\/code>:<\/strong> Throttle bandwidth to avoid saturating links.<\/li>\n\n\n\n<li><strong><code>--checksum<\/code>: <\/strong>Compare by checksum rather than size\/time (slower, more accurate).<\/li>\n\n\n\n<li><strong><code>--partial<\/code>:<\/strong> Keep partially transferred files if interrupted.<\/li>\n\n\n\n<li><strong><code>--backup --backup-dir=DIR<\/code>: <\/strong>Save modified\/removed files to a backup directory.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"trailing-slash-behavior-critical-to-avoid-mistakes\">Trailing Slash Behavior (Critical to Avoid Mistakes)<\/h2>\n\n\n\n<p><strong>rsync treats a trailing slash on the source differently:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>rsync -av \/src\/ \/dst\/<\/code> means \u201ccopy the contents of <code>\/src<\/code> into <code>\/dst<\/code>\u201d.<\/li>\n\n\n\n<li><code>rsync -av \/src \/dst\/<\/code> means \u201ccopy the directory <code>src<\/code> itself into <code>\/dst<\/code>\u201d (result: <code>\/dst\/src\/...<\/code>).<\/li>\n<\/ul>\n\n\n\n<p>When mirroring directory contents, add the trailing slash on the source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"common-rsync-use-cases-with-real-examples\">Common rsync Use Cases with Real Examples<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"1-local-backups-with-archival-mode\">1) Local Backups with Archival Mode<\/h3>\n\n\n\n<p>Preserve attributes and copy only changed files:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av \/home\/user\/Pictures\/ \/mnt\/backup\/Pictures\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"2-secure-remote-sync-over-ssh\">2) Secure Remote Sync over SSH<\/h3>\n\n\n\n<p>Use SSH for encryption and key based authentication:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Default SSH port (22)\nrsync -avz -e ssh \/var\/www\/ user@host:\/data\/www\/\n\n# Custom port (e.g., 2222)\nrsync -avz -e \"ssh -p 2222\" \/var\/www\/ user@host:\/data\/www\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"3-mirror-a-directory-add-delete-to-match-source\">3) Mirror a Directory (Add\/Delete to Match Source)<\/h3>\n\n\n\n<p>Ensure destination is an exact mirror:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Always dry-run first to confirm deletions\nrsync -av --dry-run --delete \/srv\/files\/ \/srv\/mirror\/\n\n# Then run for real\nrsync -av --delete \/srv\/files\/ \/srv\/mirror\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"4-exclude-files-and-folders\">4) Exclude Files and Folders<\/h3>\n\n\n\n<p>Skip temporary files, caches, or large folders you don\u2019t need:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av --exclude=\".git\" --exclude=\"node_modules\" --exclude=\"*.tmp\" \\\n\/project\/ \/backup\/project\/<\/code><\/pre>\n\n\n\n<p><strong>Use an exclude file for readability:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># exclude.txt\n.git\nnode_modules\n*.tmp\ncache\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av --exclude-from=exclude.txt \/project\/ \/backup\/project\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"5-incremental-backups-with-versions\">5) Incremental Backups with Versions<\/h3>\n\n\n\n<p>Store daily snapshots efficiently using hard links (<code>--link-dest<\/code>), saving space while retaining history:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Prepare directories\nsudo mkdir -p \/backups\/www\ncd \/backups\/www\n\n# Create a dated snapshot using link-dest to the latest one\nDATE=$(date +%F)\nrsync -a --delete \\\n  --link-dest=\/backups\/www\/latest \\\n  \/var\/www\/ \/backups\/www\/$DATE\/\n\n# Update the \"latest\" symlink\nrm -f \/backups\/www\/latest\nln -s \/backups\/www\/$DATE \/backups\/www\/latest<\/code><\/pre>\n\n\n\n<p>This yields fast, space efficient daily backups while allowing you to browse or restore any day.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"6-resume-interrupted-transfers\">6) Resume Interrupted Transfers<\/h3>\n\n\n\n<p>Use <code>-P<\/code> (or <code>--partial --progress<\/code>) to resume and see progress:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -avP -e ssh \/large\/archive.iso user@host:\/srv\/archive\/<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"7-verify-integrity-with-checksums\">7) Verify Integrity with Checksums<\/h3>\n\n\n\n<p>When accuracy matters more than speed, force checksum comparison:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av --checksum \/source\/ \/dest\/<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"security-best-practices-for-rsync\">Security Best Practices for rsync<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Prefer SSH transport (<code>-e ssh<\/code>) with key based auth and disable password logins on servers.<\/li>\n\n\n\n<li>Use a restricted user account for backups (least privilege). Avoid running as root unless necessary.<\/li>\n\n\n\n<li>For remote pulls that need root only files, consider <code>sudo rsync<\/code> with a tight <code>sudoers<\/code> rule.<\/li>\n\n\n\n<li>Limit SSH by IP and port, and use firewall rules; add 2FA or hardware keys for critical hosts.<\/li>\n\n\n\n<li>Avoid exposing rsync daemon directly on the internet unless you fully understand module ACLs and authentication.<\/li>\n<\/ul>\n\n\n\n<p>On <a href=\"https:\/\/www.youstable.com\/blog\/benefits-of-fully-managed-dedicated-server\/\">managed VPS or Dedicated Servers at YouStable<\/a>, you can enable SSH key only access and firewall policies from day one to secure rsync based backups without hassle.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"performance-tuning-tips\">Performance Tuning Tips<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Compress over WAN:<\/strong> <code>-z<\/code>. On fast LANs, compression can slow transfers\u2014test both ways.<\/li>\n\n\n\n<li><strong>Show progress efficiently:<\/strong> <code>--info=progress2<\/code> for large operations.<\/li>\n\n\n\n<li><strong>Choose transfer strategy: <\/strong><code>--whole-file<\/code> favors LAN throughput; <code>--inplace<\/code> avoids temporary files for very large updates.<\/li>\n\n\n\n<li><strong>Skip noise:<\/strong> Use <code>--exclude<\/code> patterns to avoid logs, caches, and build artifacts.<\/li>\n\n\n\n<li><strong>Throttle if needed:<\/strong> <code>--bwlimit=20480<\/code> limits to ~20 MB\/s to protect production traffic.<\/li>\n\n\n\n<li><strong>Increase SSH ciphers performance:<\/strong> try <code>-e \"ssh -c aes128-gcm@openssh.com\"<\/code> on modern OpenSSH for faster encryption.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rsync-daemon-mode-advanced\">Rsync Daemon Mode (Advanced)<\/h2>\n\n\n\n<p>rsync can run as a daemon (TCP 873) serving named modules. This can be efficient on trusted networks but requires careful ACLs and auth. Minimal example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \/etc\/rsyncd.conf\nuid = nobody\ngid = nogroup\nuse chroot = yes\nread only = yes\nhosts allow = 10.0.0.0\/24\n\n&#91;files]\n    path = \/srv\/exports\/files\n    comment = Files export<\/code><\/pre>\n\n\n\n<p><strong>Start the daemon temporarily:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo rsync --daemon --config=\/etc\/rsyncd.conf<\/code><\/pre>\n\n\n\n<p><strong>Connect from a client:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>rsync -av rsync:\/\/server\/files\/ \/local\/dir\/<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"troubleshooting-common-rsync-errors\">Troubleshooting Common rsync Errors<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"permission-denied\">Permission denied<\/h3>\n\n\n\n<p><strong>Cause: <\/strong>insufficient permissions or SSH auth issues. Fix: ensure correct user, file permissions, and key based SSH. Try <code>sudo<\/code> where appropriate, or adjust ownership with <code>chown<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"failed-to-set-times-ownership\">Failed to set times\/ownership<\/h3>\n\n\n\n<p><strong>Cause:<\/strong> not running as a user with privileges. Fix: run rsync with <code>sudo<\/code> on the destination or avoid preserving ownership (<code>--no-owner --no-group<\/code>) when not needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"mkstemp-failed-permission-denied\">mkstemp failed: Permission denied<\/h3>\n\n\n\n<p><strong>Cause:<\/strong> destination directory writable restrictions. Fix: check directory permissions and free space; try <code>--inplace<\/code> if temporary files are blocked.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"protocol-version-mismatch\">Protocol version mismatch<\/h3>\n\n\n\n<p><strong>Cause: <\/strong>very old rsync on one side. Fix: update rsync on both endpoints. Using SSH transport usually avoids daemon protocol issues.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"rsync-vs-scp-vs-rclone-when-to-use-what\">Rsync vs SCP vs Rclone: When to Use What<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>rsync:<\/strong> Best for incremental syncs, mirroring, backups, and partial delta updates locally or over SSH. Rich exclude\/include logic.<\/li>\n\n\n\n<li><strong>SCP\/SFTP:<\/strong> Simple file copy over SSH. No delta algorithm or advanced sync logic; good for ad hoc transfers.<\/li>\n\n\n\n<li><strong>Rclone:<\/strong> Cloud first syncing to S3, GCS, OneDrive, etc. If your target is object storage, rclone is ideal; for POSIX servers, rsync wins.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"real-world-hosting-workflows-wordpress-lamp-and-more\">Real World Hosting Workflows (WordPress, LAMP, and More)<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"deploying-a-wordpress-site\">Deploying a WordPress site<\/h3>\n\n\n\n<p><strong>Sync theme and uploads safely:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># From staging to production, preserving permissions\nrsync -avz -e ssh --exclude=\"wp-content\/cache\" \\\n\/var\/www\/stage.example.com\/ wpuser@prod:\/var\/www\/example.com\/<\/code><\/pre>\n\n\n\n<p>Pair this with a database export\/import to complete the deployment. For zero downtime migrations, place the site in maintenance mode, rsync files, sync DB, then lift maintenance.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"nightly-server-backups\">Nightly server backups<\/h3>\n\n\n\n<p>Run a cron job that uses <code>--link-dest<\/code> to create dated snapshots. Store them on a separate disk or remote backup server. If you use YouStable\u2019s VPS or Dedicated hosting, configure a secure offsite target and monitor bandwidth with <code>--bwlimit<\/code> for predictable backup windows.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"migrating-a-site-between-hosts\">Migrating a site between hosts<\/h3>\n\n\n\n<p>Use rsync over SSH to copy <code>\/var\/www<\/code>, configuration files in <code>\/etc<\/code> (carefully), and user data. Perform a final delta sync during a scheduled cutover window to capture last minute changes, then switch DNS.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"pro-tips-from-the-field\">Pro Tips from the Field<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Always run a dry run with <code>--dry-run<\/code> before using <code>--delete<\/code>.<\/li>\n\n\n\n<li>Use absolute paths in cron scripts to avoid surprises from changing working directories.<\/li>\n\n\n\n<li>Log output with <code>--log-file=\/var\/log\/rsync-backup.log<\/code> for audits and troubleshooting.<\/li>\n\n\n\n<li>Combine rsync with snapshots (LVM, ZFS, Btrfs) for consistent backups of live data.<\/li>\n\n\n\n<li>For databases, dump first (<code>mysqldump<\/code> or <code>pg_dump<\/code>), then rsync the dump files.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<h2 class=\"wp-block-heading\" class=\"wp-block-heading\" id=\"faqs\">FAQs<\/h2>\n\n\n<div id=\"rank-math-faq\" class=\"rank-math-block\">\n<div class=\"rank-math-list \">\n<div id=\"faq-question-1765470547364\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"is-rsync-faster-than-scp\">Is rsync faster than scp?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes, for repeated transfers or large directories, rsync is typically faster because it copies only changed data. scp always transfers entire files. On a first full copy, speeds may be similar; rsync shines on subsequent runs.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470555834\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"does-rsync-do-incremental-backups-automatically\">Does rsync do incremental backups automatically?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>rsync always transfers only changed portions, but for versioned snapshots you must use <code>--link-dest<\/code> or <code>--backup --backup-dir<\/code>. This stores incremental history while keeping space usage low via hard links.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470564300\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-do-i-exclude-multiple-patterns-cleanly\"><strong>How do I exclude multiple patterns cleanly?<\/strong><\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Create a file with one pattern per line (e.g., <code>exclude.txt<\/code>) and use <code>--exclude-from=exclude.txt<\/code>. This is more maintainable than chaining many <code>--exclude<\/code> flags in scripts.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470572433\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"which-port-does-rsync-use\">Which port does rsync use?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Over SSH, rsync uses the SSH port (default 22). In daemon mode, it uses TCP 873. For internet facing setups, prefer <a href=\"https:\/\/www.youstable.com\/blog\/ssh-keys-vs-password-authentication\/\">SSH and restrict access via firewall and keys<\/a>.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470587922\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"why-are-file-permissions-different-at-the-destination\">Why are file permissions different at the destination?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Make sure you use <code>-a<\/code> to preserve metadata and run with sufficient privileges at the destination. Filesystems mounted with restrictive options or remote users lacking ownership rights can prevent proper preservation.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470598167\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"how-can-i-speed-up-rsync-on-a-high-speed-lan\">How can I speed up rsync on a high-speed LAN?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Disable compression (<code>--no-compress<\/code> or omit <code>-z<\/code>) and consider <code>--whole-file<\/code>. <a href=\"https:\/\/www.youstable.com\/blog\/how-to-increase-file-upload-size-in-directadmin-2\/\">Increase SSH cipher performance and exclude unnecessary files<\/a>. Use SSDs on both ends to remove I\/O bottlenecks.<\/p>\n\n<\/div>\n<\/div>\n<div id=\"faq-question-1765470607483\" class=\"rank-math-list-item\">\n<h3 class=\"rank-math-question \" class=\"rank-math-question \" id=\"is-rsync-safe-for-live-websites\">Is rsync safe for live websites?<\/h3>\n<div class=\"rank-math-answer \">\n\n<p>Yes, especially for static assets. For dynamic sites (WordPress), place the site in maintenance mode during final syncs, and dump\/sync databases atomically. Use snapshots or maintenance windows for transactional consistency on busy servers.<\/p>\n\n<\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>The rsync command in Linux is a fast, reliable file synchronization and backup utility that copies only changed data using [&hellip;]<\/p>\n","protected":false},"author":13,"featured_media":15457,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"iawp_total_views":0,"footnotes":""},"categories":[350,1195],"tags":[],"class_list":["post-12325","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-knowledgebase","category-blogging"],"acf":[],"featured_image_src":"https:\/\/www.youstable.com\/blog\/wp-content\/uploads\/2025\/12\/Rsync-Command-in-Linux.jpg","author_info":{"display_name":"Prahlad Prajapati","author_link":"https:\/\/www.youstable.com\/blog\/author\/prahladblog"},"_links":{"self":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/comments?post=12325"}],"version-history":[{"count":9,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12325\/revisions"}],"predecessor-version":[{"id":19634,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/posts\/12325\/revisions\/19634"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media\/15457"}],"wp:attachment":[{"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/media?parent=12325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/categories?post=12325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.youstable.com\/blog\/wp-json\/wp\/v2\/tags?post=12325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}