Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
VGSources
Blog

How to Use the rsync –delete Option Safely

A practical guide to rsync --delete: understand deletion scope, avoid wildcard and filter mistakes, review a complete dry run, choose deletion timing, preserve backups and recover from accidents.
Length9 min Posted Quest giverVGSources Team
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use rsync --delete only after a complete dry run confirms every proposed deletion. The option removes files and directories from the receiving side when they are absent from the sending side. It applies to synchronized directories, not to an arbitrary disk, and ordinary exclude rules protect excluded destination files. A safe run confirms both paths, reviews itemized output, preserves recoverable copies when the data matters, and leaves --ignore-errors disabled unless deletion after source I/O errors is an intentional choice.

The command does not provide an undo button. Recovery depends on a backup made during the run, a snapshot, or another independent copy, so the preparation is part of the operation rather than an optional precaution.

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.

What --delete actually deletes

Rsync compares the selected source tree with the selected destination tree. With --delete, an entry that exists in the receiving directory but has no corresponding entry in the sending directory is considered extraneous and is removed. The comparison is limited to directories that the command is synchronizing; it is not a general-purpose cleanup of unrelated destination paths.

For example, if /srv/source/old-level.dat has been removed from the source and /srv/destination/old-level.dat still exists, a synchronized run with --delete proposes deletion of the destination copy. If the file still exists in the source, rsync does not delete it merely because it is old or unchanged. A file changed on the source is normally transferred or updated, not treated as an extraneous destination file.

#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.

Excluded files are normally protected

Standard exclude rules have an important safety effect: an excluded destination file is not removed by ordinary deletion processing. This lets you mirror a managed subset of a directory while retaining files that are intentionally outside that subset.

--delete-excluded changes that property. It allows excluded files to be deleted as well, so it should be treated as a separate, higher-risk mode. Receiver-side filter rules can also alter what the receiving side considers protected. Review every include and exclude rule in the same dry run as the deletion option.

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

The source and destination roles matter

Rsync’s first path is the sending side and the second path is the receiving side. Reversing them can make a valid command destructive in the opposite direction. Verify the host, mount point, account, and directory on both ends before adding deletion.

Why the trailing slash and path form matter

Use the directory paths deliberately. A pattern such as /srv/source/ means the contents of that directory are synchronized into the destination directory. The exact path form determines which tree rsync walks and therefore which destination entries can be judged extraneous.

A shell wildcard is expanded before rsync starts. For instance, the shell may turn /srv/source/* into a list of current children. That can prevent rsync from treating /srv/source as the synchronized parent tree and can change deletion behavior. Do not substitute a wildcard for a directory path unless you have specifically verified the resulting file list and its deletion scope.

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

The safe workflow

  1. Identify the tree. Confirm that the source is the intended directory, is mounted, and is readable. Confirm that the destination is the intended receiving directory on the intended host.
  2. Use explicit directory paths. Prefer a form such as /srv/source/ to /srv/destination/, with the trailing-slash behavior you intend. Avoid an unexamined source/* expansion.
  3. Run the complete command as a dry run. Add --dry-run (or -n) and --itemize-changes. Keep the same archive, filter, remote, and deletion options that the real run will use.
  4. Inspect every deletion. Search the output for lines containing *deleting. Do not proceed while a deletion is unexplained. Check spelling, case, mount status, filters, and the source’s current contents when a line is surprising.
  5. Review filters separately. Confirm that intended exclusions remain protected. Treat --delete-excluded as a deliberate change in policy, not as a small variation of the normal command.
  6. Add a recovery path for valuable data. Use --backup and a separately managed --backup-dir when replaced or deleted destination files must be recoverable.
  7. Execute the reviewed command. Remove only --dry-run; keep the paths, filters, timing mode, and safety options unchanged. Log the run and retain the backup directory according to your recovery policy.
  8. Keep error protection enabled. Do not add --ignore-errors unless you have consciously accepted deletion despite sender-side I/O errors.

Build and review a dry run

A dry run should be the full production command with simulation enabled, not a simplified test that omits the options which determine the file set. The basic pattern is:

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.
rsync -a --dry-run --itemize-changes /srv/source/ /srv/destination/

Here -a is the archive-style transfer selection used in the example; adapt permissions, ownership, ACL, extended attributes, remote-shell settings, and filters to your environment. The significant safety feature is that rsync calculates and reports changes without applying them.

How to read the output

  • Lines marked with *deleting identify destination entries that the simulated run would remove.
  • Other itemized lines can indicate files to create, update, or alter metadata on the destination. Review them too: an unexpectedly broad transfer often signals the wrong path, mount, or filter.
  • A dry run is meaningful only when the source is in its normal mounted and readable state. If the source is empty because a filesystem failed to mount, rsync can correctly interpret that empty view as a tree from which destination files are absent.

Save the output when the run is operationally important. A saved report gives another administrator a concrete list to approve and makes it easier to compare the actual execution with the reviewed plan.

Protect recoverable copies with backups

--backup tells rsync to rename pre-existing destination files as they are transferred or deleted. --backup-dir places those renamed files in a separate directory, allowing a deleted destination file to be recovered without reconstructing it from memory.

rsync -a --backup --backup-dir=/srv/rsync-trash/ --delete /srv/source/ /srv/destination/

Run the same command with --dry-run --itemize-changes first. Ensure the backup directory is outside the mirrored tree. If it lies inside that tree, the next synchronization can treat the recovery copies as extraneous and remove them. Alternatively, protect an in-tree location with explicit filter rules and verify those rules in the dry run; an external directory is easier to reason about.

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)

Manage the backup directory as a retention system

  • Give it enough capacity for the files that may be replaced or deleted.
  • Restrict access because it can contain historical or sensitive data.
  • Record which synchronization created each backup set, especially when several jobs share a host.
  • Define a retention period and an independent backup or snapshot if the recovery copies are important.
  • Do not assume that a successful rsync run also protects the backup directory from disk failure; it is still a single storage location unless separately copied.

Choose deletion timing deliberately

Rsync offers deletion timing modes that determine when destination deletions occur relative to file transfer. Selecting one explicitly avoids relying on version-dependent defaults.

Mode When deletions occur Operational considerations
--delete-during While each directory is being processed during the transfer. Default timing in rsync 3.0.0 and newer when no timing option is supplied. Deletions and transfers can interleave, so an interrupted run can leave a partially updated destination.
--delete-before Before the associated transfer work. Older rsync versions use this as the default when no timing option is supplied. Removing files first can free destination space, but an interruption after deletion and before transfer leaves the destination missing those files.
--delete-after After the transfer work. Can keep old destination files available until new content has been transferred. Per-directory merge-file rules must be in effect before deletion; postponing deletion can also require more destination space during the run.

The table describes ordering, not a guarantee of transactional behavior. None of these modes makes a run atomic or supplies rollback. For reproducible operations across hosts, specify the timing mode rather than depending on the default, particularly when one host may run an rsync version older than 3.0.0.

Understand error behavior before enabling deletion

Rsync normally disables destination deletions when the sending side reports I/O errors. This protection helps prevent an unreadable or incompletely mounted source from making the destination look like an intentionally pruned mirror.

--ignore-errors overrides that protection. With it enabled, rsync can continue deleting destination entries even when sender-side I/O errors occurred. Use the option only when the consequences are understood and an alternate recovery mechanism is in place. It is not a routine fix for a failed disk, a missing mount, or transient read errors.

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

When a dry run shows an unexpectedly empty source

  1. Stop before executing the deletion.
  2. Check that the source filesystem is mounted at the expected path.
  3. List representative directories and files using a non-destructive command.
  4. Check read errors and the account’s permissions.
  5. Repeat the dry run after the source is healthy.

A dry run against an empty mount point is not proof that the destination should be emptied; it is a signal to verify the source environment.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Common ways the wrong files get deleted

Reversed paths

Putting the destination first makes the formerly receiving tree the source and changes which side is eligible for deletion. Read the command aloud as “send this tree to that tree” before running it.

Wrong host or mount point

Remote-shell syntax can still point to a valid directory on the wrong machine. Confirm the remote identity and inspect the destination path interactively when possible. A mounted backup disk can also hide the directory contents that you thought you were synchronizing; verify mounts before the dry run.

Wildcard expansion

As described above, the shell expands wildcards before rsync sees them. The resulting argument list may no longer represent one parent tree, so use explicit directory paths for mirror operations.

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

Filter changes

An added exclude can protect files you expected to mirror, while --delete-excluded can remove files you expected to retain. Keep filters under version control or in a reviewed job configuration and inspect their effect in itemized output.

Concurrent writers

If applications continue creating, renaming, or deleting files while rsync scans the source, the dry-run plan can become stale before execution. Quiesce writers, use an application-consistent snapshot, or accept and document the race. The supplied command options do not make a live filesystem snapshot.

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.

A production-ready command pattern

The following two-command pattern separates review from execution:

rsync -a --dry-run --itemize-changes /srv/source/ /srv/destination/

After every deletion and unexpected transfer has been approved:

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.
rsync -a --backup --backup-dir=/srv/rsync-trash/ --delete /srv/source/ /srv/destination/

Add the filter, remote-shell, metadata, and explicitly selected deletion-timing options required by your environment to both commands. Do not add an option to the real run that was absent from the reviewed dry run. If you choose a timing mode for predictable behavior, place the same mode in both commands.

What to do after an accidental deletion

Stop subsequent synchronization jobs first; another run can delete or overwrite the remaining evidence. If --backup --backup-dir was used, locate the renamed file in the backup directory and restore it to the destination after confirming its path and permissions. Preserve the backup set until the restoration has been verified.

If no rsync backup was made, rsync itself has no built-in undo operation. Recovery must come from an independent filesystem snapshot, backup system, replica, or the original source if the source copy still exists. Avoid experimenting on the only remaining copy; restore into a separate location, verify the contents, and then copy the verified result back.

Pre-flight checklist

  • Source host, mount, account, and directory are confirmed.
  • Destination host, mount, account, and directory are confirmed.
  • Directory paths—not an unexamined wildcard—are used.
  • The source is readable and contains the expected top-level entries.
  • Archive, metadata, include, and exclude options match the intended policy.
  • --delete-excluded is absent unless explicitly required and approved.
  • The exact production command has been run with --dry-run --itemize-changes.
  • Every *deleting line is expected.
  • --backup and an external, managed --backup-dir are configured when recovery matters.
  • --ignore-errors remains disabled unless deletion after sender I/O errors is intentional.
  • Logging and backup retention are defined.
  • Concurrent writers are stopped or the consistency limitation is accepted.

The Bottom Line

Safe rule: treat --delete as a reviewed mirror policy, not a convenience flag. Verify both directory paths and the source mount, dry-run the complete command, inspect every *deleting entry, preserve recoverable copies for valuable data, and leave --ignore-errors off by default.

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
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

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.