Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
VGSources
Blog

How to Use rsync to Back Up and Sync Files Between Servers

A practical guide to backing up and synchronizing server directories with rsync over SSH. Learn push and pull workflows, preview changes, avoid dangerous deletions and verify restores.
Length10 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use rsync over SSH to compare a source tree with a destination and transfer only the files that need updating. Start with archive mode (-a), preview every job with --dry-run, and add destructive or move-oriented options only after you have confirmed the direction, paths, account permissions and expected file list.

What rsync does between servers

rsync walks the source and destination directory trees, compares file attributes and content, and sends only the changes needed to bring the destination up to date. For server-to-server work, SSH is the usual transport because it provides the remote shell and encryption in one connection.

As an Amazon Associate I earn from qualifying purchases.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A normal backup copies new and changed files without removing anything that already exists at the destination. A mirror goes further: --delete removes destination-only files inside the synchronized scope. A move workflow uses --remove-source-files to delete successfully transferred non-directory files from the sender. Those are different outcomes and should never be selected interchangeably.

Prepare both servers safely

Install and identify the endpoints

Install rsync on both hosts with each operating system’s package manager. Decide which machine will initiate the connection. In a push backup, the source server connects to the backup server. In a pull backup, the backup server connects to the source.

#1 Best Overall
Sale
Gaoye Blue Light Blocking Glasses
  • BLUE LIGHT BLOCKING GLASSES: Our blue light glasses for women boast UV400 protection, blocking harmful blue rays from computer screens. With these bluelight glasses women, you can enjoy gaming, reading, or watching TV with no worries of eye strain.
  • EYE RELIEF: Our blue light glasses are engineered to reduce blurry vision or strain caused by prolonged screen time. These womens blue light glasses aid in better sleep by preventing blue light from disrupting your natural sleep cycle, helping you fall asleep faster and enjoy a more restful night's sleep, making them the perfect christmas present.
  • COMFORTABLE: Crafted from durable material, our trendy blue light glasses for woman or blue light glasses men ensure long-lasting comfort. The high-transmittance lenses accessories, gamer gifts for men, help keep your eyes relaxed. Perfect stocking stuffers, gifts for gamers men, christmas gifts for men, halloween costumes.
  • LIGHTWEIGHT: These clear blue light glasses feature a lightweight frame, meaning they’ll stay comfy for long-term wear. Perfect as blue blockers glasses for women or mens blue light glasses, these non-prescription fake glasses for men can be worn throughout the day. The blue light blocking glasses women feature polycarbonate HD lenses, which are anti-reflective and restore true color.
  • WORRY-FREE PURCHASE: If you experience any issues, our support team is ready to assist you quickly. These are the perfect costume glasses for cosplay dressing up.

Use absolute paths for the data and destination directories. Relative paths make scheduled jobs harder to audit and can point somewhere unexpected when a scheduler supplies a different working directory.

Verify SSH before adding rsync

  1. From the initiating host, log in to the remote host with the exact account that the job will use.
  2. Verify the remote host key before accepting it. A changed or unexpected key should be investigated rather than bypassed.
  3. Confirm that the account can read every source path needed for a pull or push operation.
  4. Confirm that it can create and modify files in the destination directory.
  5. Use a dedicated account whose access is restricted to the paths required by the backup. Do not give a backup job broader access than its function needs.

Test read access on the source and write access on the destination before scheduling. Also check destination free space, quotas and inode availability; a job can fail even when the apparent byte capacity looks sufficient if it cannot create more directory entries.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Understand rsync’s source and destination syntax

An rsync command has a source, a destination and, for a remote transfer, a remote account and host. The colon in a target such as [email protected]:/srv/backups/data/ tells rsync that the path is on another host.

The trailing-slash rule

A trailing slash changes whether rsync copies a directory itself or the directory’s contents:

  • /srv/data/ means “copy the contents of data.”
  • /srv/data means “copy the directory named data,” placing that directory under the destination path.

Write both paths explicitly and check the dry-run listing. A missing or extra slash can produce a nested path such as /srv/backups/data/data/ when you intended the files to land directly in /srv/backups/data/.

Use archive mode as the normal starting point

-a, or --archive, enables archive mode. It is equivalent to -rlptgoD: recursive copying plus preservation of common permissions, modification times, group and owner information, symbolic links and device-related metadata where the account and platform allow it. Archive mode is the practical baseline for a server backup because it preserves directory structure and metadata instead of treating the source as a plain collection of file contents.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Metadata preservation still depends on privileges and filesystem support. If the remote account cannot set an owner or group, rsync may copy the data while reporting a metadata warning or error. Read the command’s exit status and output instead of assuming that a completed transfer reproduced every attribute.

Rank #2
Windex Gaming Cleaning Wipes, Pre-Moistened Wipes to Instantly Clean all Gaming Gear and Electronics, Resealable Packaging for a Freshness Lock, 25 count (Pack of 1)
  • WINDEX GAMING WIPES: effortlessly clean all your gaming gear and gaming electronics in one easy step with our new Windex Gaming Wipes
  • AMMONIA FREE: our ammonia-free formula is safe to use on all of your favorite gaming equipment like consoles, headsets, controllers, screens, keyboards, and more
  • PRE-MOISTENED WIPES: each wipe instantly removes dust, dirt, and stubborn smudges and fingerprints leaving a streak-free shine
  • ANTI-STATIC: great for cleaning and wiping down your gaming gear and electronics leaving behind no visible residue
  • COMPACT RESEALABLE PACKAGE: store your pack of Windex Gaming Wipes anywhere in your home for whenever a quick and easy wipedown is needed

Push a backup from the source server

A push is appropriate when the source host is allowed to initiate an SSH connection to the backup host. The source path below ends in a slash so that its contents, rather than an additional data directory, are copied.

1. Preview the push

rsync -a -n -v -e ssh /srv/data/ [email protected]:/srv/backups/data/

-n is the short form of --dry-run; it performs a trial run without changing files. -v (--verbose) shows more transfer information, making the proposed additions, updates and deletions easier to inspect. -e ssh explicitly selects SSH as the remote-shell transport; it can be omitted when SSH is already the default and no custom transport settings are needed.

2. Review the output

  • Check the source hostname and the destination hostname.
  • Check both absolute paths and the trailing slash on each path.
  • Look for unexpected directories, permission errors or files outside the intended scope.
  • If the output is large, save it to a log for review and later comparison.

3. Run the real backup

rsync -a    -v -e ssh /srv/data/ [email protected]:/srv/backups/data/

Removing -n allows the transfer. Keep the command otherwise identical to the reviewed preview so that the operation you execute is the one you approved.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Pull a backup from the source server

A pull is useful when the backup server should control when data is retrieved. The backup host initiates SSH and writes into its local backup directory.

1. Preview the pull

rsync -a -n -v -e ssh [email protected]:/srv/data/ /srv/backups/data/

2. Check permissions and paths

The remote account must have read access to /srv/data/. The local account running rsync must have write access to /srv/backups/data/. Confirm both before the first real run.

3. Run the pull

rsync -a    -v -e ssh [email protected]:/srv/data/ /srv/backups/data/

Push and pull use the same comparison and transfer behavior; only the side that opens the SSH connection and supplies the local path changes.

Preview every change with --dry-run

The rsync manual describes --dry-run as a trial run that “doesn’t make any changes.” Treat it as a required safety step before the first real run, after changing paths or filters, and before using any option that can remove files.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
LISEN Cell Phone Stand Phone Holder for Desk, Office Decor Gadgets for Men
  • Ergonomic & Adjustable Design: Fight "text neck" and improve your posture. Designed for comfort, it offers an adjustable height (7.1in-8.5in) (1.4in adjustable range) and angle (5°-85°) Please note: cell phone stand is only 9 inches tall—the length of a standard pencil
  • Without blocking subtitles Perfect for office desk Tiktok Face Time Zoom video—this is the ultimate kitchen desk essential for phones! Perfect viewing experience while reducing neck back strain, A must-have for gamers streamers desk, and anyone who values both style and support!
  • Sleek & Stable Design fits Otterbox Case: Say goodbye to bent cables, tangles, and tip-overs! LISEN’s stylish adjustable desk phone holder features a built-in charging hole and smart cable management, keeping your phone secure and your workspace clutter-free cool gadgets for men
  • ANTI-SLIP DESIGN free hands: The under 10.00 items easy gadgets back and the bottom of this kitchen essentials for women are fully covered by anti-skid silicone, which LISEN stand up desk decor can provide maximum protection device from any scratches and slides
  • Your Perfect Viewing Companion:If your product arrives damaged or breaks within 365 days, reach out to LISEN for a quick and hassle-free solution. Struggling with assembly, like tightening the screw? We’ve got your back! Your experience matters to us. (Product including: phone Holder stand*1, screw*1, hexagon screwdriver*1, specification*1)

A dry run is not a substitute for checking the command itself. It reports what rsync would do for the supplied source, destination, account and rules. If you correct a typo or change an exclusion, perform another preview; do not rely on an earlier listing.

For an auditable check, save the verbose output while retaining -n:

rsync -a -n -v -e ssh /srv/data/ [email protected]:/srv/backups/data/ > /var/log/rsync-data-dry-run.log

Review the complete log, not just the final summary. Non-zero exit status, authentication failures, unreadable files and inability to preserve attributes all require attention before treating the backup as successful.

Mirror a directory with --delete

Add --delete only when the destination must match the source, including removal of destination-only files within the synchronized directories. The rsync manual warns: “This option can be dangerous if used incorrectly!” A stale file at the destination may be the only copy of data that was intentionally removed from the source.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Preview the mirror first

rsync -a -n -v --delete -e ssh /srv/data/ [email protected]:/srv/backups/data/

Read every deletion in the dry-run output. Confirm that the source is the authoritative tree, that the destination path is correct, and that no needed file exists only on the destination. Only after that review should you run the same command without -n:

rsync -a    -v --delete -e ssh /srv/data/ [email protected]:/srv/backups/data/

Deletion is scoped to the directories being synchronized. File-selection rules also matter: excluded files are normally protected from deletion unless deletion of excluded files is explicitly enabled. Therefore, review --exclude and --include rules together with the delete policy, not as separate settings.

Keep replaced destination files with --backup

If you need rollback copies when destination files are replaced or deleted, use --backup. The manual states that pre-existing destination files are renamed as each file is transferred or deleted. Add --backup-dir to put those copies in a separate directory.

Rank #4
Ledagic IC+RGBW USB Powered Led Light Bar with App & Remote Control, 2 Pack
  • Easy Installation: Our gaming lights have been designed to enhance your entertainment experience. Simply position the led light bar next to your TV or game console to create a game room environment with ease. They come with USB power and a 60 inch cord for direct mounting and mobility
  • Audio Syncing & Extensive Mode: The built-in high-sensitivity music sensor allows you to sync the TV led lights to your favorite music. Lights react and move to the beat of music, film and game audio, creating an incredible immersive sound and light experience – and all without the need for an additional hub. You can choose from 64+ patterns, including strobe, illusion, jump, energy, gradient, running, chasing, fluttering mode etc. Each mode can be applied to different scenes
  • 64+ Chasing IC+RGB & W Effect: The independent control design of IC+RGB and white all-in-one multifunctional rgbw led bar lights monitor backlight allows you to easily switch the led lights for desk between IC+RGB and white to enjoy a variety of lighting effects, you can choose white lighting mode with high brightness for better illumination when working, etc. Choose IC+RGB lighting mode when you need to create an entertaining atmosphere for the light show, 16 million colours of Color changing rgb light bar let you dance to the beat and create a dynamic party atmosphere
  • Dynamic and Dimmable Lights: 1%-full brightness free brightness adjustment gives you the flexibility to adjust dimmable led light bar for room decorations or a variety of occasions
  • USB Powered: USB light bars for room can be powered by powernank, usb charger, TV, Monitor, laptop PC mainframe, making behind TV led lighting bar easy to install in any location.TV led lights are powered by the TV usb interface / PC mainframe, can be turned on/off synchronously with TV / PC
rsync -a -n -v --backup --backup-dir=/srv/backups/changed/ -e ssh 
  /srv/data/ [email protected]:/srv/backups/data/

Inspect the dry run, then remove -n for the approved operation. The backup directory must itself have suitable space and permissions. These copies provide a rollback aid for replaced files; they are not a complete snapshot system or an immutable backup. They do not by themselves preserve an independently restorable view of every point in time.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Control which files are transferred

--exclude removes matching paths from the transfer set, while --include allows selected paths when a broader exclusion would otherwise omit them. Because selection rules affect what rsync sees as part of the synchronized tree, test them with a dry run before combining them with --delete.

  • Start with the narrowest source path that contains the data you actually want.
  • Put exclusions and inclusions in the same reviewed command used for the real run.
  • Check whether an excluded destination file should remain protected or whether your policy explicitly requires removing excluded files.
  • Keep a copy of the final command in the job documentation so a future operator can see the exact file-set rules.

Use --remove-source-files only for an intentional move

--remove-source-files removes successfully transferred non-directory files from the sending side. It is suitable for a deliberate move or spool-draining workflow, not for an ordinary backup. A backup normally keeps the source; a move intentionally does not.

Preview the transfer without the removal option first. Confirm that the destination is writable, that the account can read every intended file and that the destination contains the data you expect. Add --remove-source-files only after that behavior has been explicitly approved. Directories are not removed by this option, so an empty directory structure may remain on the sender.

Choose the design that matches the outcome

Design Initiating side Deletion behavior Rollback or retention Typical command features
One-way push backup Source server Destination-only files are kept Existing destination files are not separately retained unless backup options are added -a -n -v -e ssh for preview, then the same command without -n
One-way pull backup Backup server Destination-only files are kept Existing destination files are not separately retained unless backup options are added Remote source with a local destination, using archive mode
Mirror Either side, depending on push or pull --delete removes destination-only files within synchronized directories Use --backup and --backup-dir if replacement copies are required Always dry-run and inspect deletion lines first
Changed-file retention Either side Deletion or replacement can create retained copies --backup --backup-dir=/srv/backups/changed/ Provides rollback copies, not immutable snapshots
Move workflow Sender transfers to receiver Successfully transferred non-directory files are removed from sender Destination becomes the retained location --remove-source-files, used only after a reviewed preview

Schedule recurring jobs responsibly

  1. Run a dry run and save its output to a log while you develop the command.
  2. Confirm source and destination hostnames, absolute paths and trailing-slash intent.
  3. Confirm that the SSH account has exactly the intended permissions and no broader access than necessary.
  4. Check destination free space, quotas and inode availability.
  5. Classify the job as a one-way backup, a mirror or a move. Select --delete or --remove-source-files only when that behavior is intentional.
  6. Schedule the reviewed command with the platform’s service scheduler.
  7. Alert on a non-zero exit status and retain enough output to investigate failures.

Do not assume that a scheduler runs with the same environment, account or working directory as an interactive shell. Absolute paths, an explicit SSH account and a tested key policy make the scheduled job easier to reproduce.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Validate that the backup can actually be restored

An rsync process can finish while the resulting data is incomplete, inaccessible or missing required metadata. Periodically perform a restore test on a suitable destination. Select representative directories and files, restore them, check that they open correctly and verify permissions and ownership where those attributes matter.

For a mirror, test the recovery process separately from the synchronization process. A mirror that faithfully reproduces accidental deletions is not a historical backup. If you rely on --backup-dir, verify that retained copies can be located and restored before you need them.

Best Value
Sale
HUANUO FlowLift™ Dual Monitor Stand, Fully Adjustable Gaming Monitor Desk Mount for 13–32″ Computer Screens, Full Motion VESA 75x75/100x100 with C-Clamp & Grommet Base, Each Arm Holds 4.4 to 19.8 lbs
  • Compatible with Wide Screens - To ensure compatibility with the dual monitor mount, your each monitor must meet three conditions at the same time: First, computer screens size range: 13 to 32 inches. Second, screen weight range: 4.4 to 19.8 lbs. Third, the back of the monitor screen must have VESA mounting holes with a pitch of 75x75mm or 100x100mm.
  • Regarding the compatibility with desks - Your desk must meet three conditions at the same time: First, desk material: Only wooden desks are recommended, plastic or glass desks cannot be used. Second, desk thickness range: 0.59" - 3.54". Third, the bottom of the desk should not have any cross beams or panels, as this will interfere with installation. We recommend carefully checking that your desk and monitors meets all above conditions before purchasing.
  • Dual C-Clamp Hold - Worried your dual monitors might wobble or slip? Our upgraded base uses a larger platform plus a dual C-clamp structure to lock the dual monitor arm firmly to your desk. Each arm safely keeps your screens steady while you type, click and game—no shaking, no sliding, just a clean and secure setup you can trust every day. It also provides Grommet Mounting installation choice, both options ensure stable and secure fixation for your 0.59" - 3.54" desk.
  • Full-Motion Adjustment For Comfortable View - Pull the screen closer when you’re deep in a spreadsheet, push it back to watch videos, or rotate to portrait for coding — moving everything smoothly with just one hand. The monitor stand offers +85°/-50° tilt, ±90° swivel and 360° rotation. Raise your monitor up to 15.75″ to support a healthy sitting posture. Whether you’re working from home, gaming through the night, or switching between video calls and documents, getting the screens to your natural line of sight helps relieve neck, shoulder and back strain so you can stay focused longer with less fatigue.
  • Keep Your Desk Organized: By lifting both screens off the desktop, this dual monitor stand opens up valuable space for your keyboard, notebook, docking station or a simple, clutter-free work area. Built-in cable management guides wires along the arms, keeping cords out of sight and out of the way. Enjoy a tidy, modern workstation that looks as good as it feels to use.

Troubleshoot common failures

The destination contains an unexpected nested directory

Recheck the trailing slash on the source. /srv/data/ copies the contents; /srv/data copies the directory itself. Correct the path, run a dry run and inspect where the files would land before running again.

Authentication or host-key errors stop the job

Confirm the SSH username, remote hostname, key policy and accepted host key from the initiating host. Test an interactive SSH login with the same account. Do not work around an unexpected host-key change without determining why it changed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Files transfer but ownership or other metadata does not

Archive mode requests preservation, but the account and filesystem must permit it. Check the verbose output and exit status, then adjust account privileges or the target filesystem policy deliberately. Treat a metadata warning as a backup-quality issue when ownership or permissions are required for recovery.

The mirror wants to delete too much

Stop before the real run. Verify the source and destination hosts, check the synchronized path, inspect include and exclude rules, and rerun with -n -v --delete. If the destination should retain files that are absent from the source, remove --delete and use a normal one-way backup instead.

The job reports success but no usable restore exists

Check free space, quotas and inode availability, then examine the saved output and exit status. Perform a restore test rather than relying on transfer completion. A successful synchronization is evidence that rsync finished its operation, not proof that the backup meets your recovery needs.

Final operating checklist

  • Both hosts have rsync installed.
  • SSH login, host-key verification and account permissions have been tested.
  • Source and destination are identified with absolute paths.
  • Trailing-slash behavior is intentional and visible in the command.
  • Archive mode is used when directory structure and common metadata must be preserved.
  • A dry run was reviewed immediately before the real command.
  • --delete is present only for an approved mirror, with every proposed deletion checked.
  • --backup and --backup-dir are used when replacement copies are required, with enough destination capacity.
  • --remove-source-files is used only for an intentional move.
  • Scheduled runs alert on non-zero exit status.
  • A restore test has demonstrated that the copied data is usable.

Bottom line

For most server backups, begin with archive mode over SSH, preview with --dry-run, and run the approved command without changing its paths or filters. Add --delete only for a deliberately maintained mirror, use --backup-dir when changed destination files need rollback copies, and reserve --remove-source-files for a true move. Regular restore tests are what turn a completed rsync transfer into a dependable backup.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More quests from Patch Notes

  1. How to Set Up a RedM (RDR2) Server in 2026: License Key, txAdmin and server.cfg, Step by StepBlog11min
  2. Best RedM (RDR2) Server Hosting in 2026: Comparing Four Hosts on Slots, Memory and PriceBlog10min
  3. How to Host a Mindustry Server in 2026: server-release.jar, Port 6567 and the Commands That MatterBlog7min
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.