Best Way to Perform a Partial Backup of Your Files

Abstract: Use rsync or PowerShell to selectively copy specific file types while excluding system and temporary data during partial backups.

Created: 2026-08-15 by
Performing a partial backup from an external hard drive to your home directory requires careful selection of files and directories to ensure no critical data is omitted. The most reliable method involves using command-line tools like rsync on Linux or macOS, or PowerShell scripts on Windows, which allow precise filtering based on file extensions, sizes, or modification dates. These tools preserve directory structures and permissions while skipping unnecessary system files, ensuring a clean and complete subset of your data is copied without cluttering your local storage with redundant or temporary files that do not belong in your primary workspace.

Choosing the Right Tool for Your Operating System

The foundation of any successful partial backup lies in selecting the appropriate utility for your operating system. While graphical user interfaces offer convenience, they often lack the granular control needed to exclude specific hidden files or preserve complex permission sets. Command-line tools provide the necessary precision to define exactly what constitutes a "partial" backup. For users on Linux and macOS, rsync is the industry standard. It offers robust features such as delta transfers, which only copy changes since the last backup, and the ability to preserve symbolic links, device files, and ownership attributes. On Windows systems, PowerShell provides powerful scripting capabilities through cmdlets like Copy-Item and Select-Object, allowing administrators to filter files based on properties before initiating the copy operation. Understanding these native tools ensures that your backup strategy is both efficient and reproducible across different environments.

Configuring Rsync for Precise Filtering

When using rsync, the key to a successful partial backup is mastering the include and exclude patterns. These patterns are evaluated in order, meaning the first match wins. A common mistake is placing broad exclude rules before specific include rules, which results in important files being skipped inadvertently. To prevent missing important files, you must explicitly define what you want to keep before excluding everything else. Consider a scenario where you want to back up only documents and images from a large media library. You would start by including those specific extensions and then exclude all other content. The command structure typically looks like this:
rsync -av --include='*.pdf' \
--include='*.jpg' \
--exclude='*' \
/source/ /destination/
In this example, the -a flag preserves archive attributes, ensuring that directory structures remain intact. The --include flags specify the file types you wish to retain. Crucially, the final --exclude='*' rule acts as a catch-all, ensuring that no other files are transferred. This logic prevents the accidental copying of temporary files, cache directories, or system metadata that could bloat your destination drive. It is also vital to understand the behavior of trailing slashes in source paths. A trailing slash on the source path means rsync copies the contents of the directory into the destination, whereas omitting it copies the directory itself. Misunderstanding this can lead to nested directory structures that are difficult to navigate later. Always verify your path syntax to ensure the resulting folder hierarchy matches your expectations.

Implementing PowerShell Filters for Windows Users

Windows users can achieve similar results using PowerShell, which offers a flexible object-oriented approach to file manipulation. Instead of simple string matching, PowerShell allows you to inspect file objects and make decisions based on their properties, such as creation date, size, or extension. This is particularly useful when you need to back up files modified within a specific timeframe or larger than a certain threshold. A typical script might involve piping the output of Get-ChildItem through Where-Object to filter the results before passing them to Copy-Item. This method ensures that only the selected items are processed, reducing the risk of overwriting existing files or consuming excessive disk space.
Get-ChildItem -Path "D:\ExternalDrive" -Recurse |
Where-Object { $_.Extension -in @('.docx', '.xlsx') -and $_.LastWriteTime -gt (Get-Date).AddDays(-30) } |
Copy-Item -Destination "C:\Users\Home\Backup" -Force
This script recursively searches the external drive for Word and Excel documents modified in the last 30 days and copies them to the user's home directory. The -Force parameter ensures that existing files are overwritten if necessary, though caution should be exercised to avoid data loss. By leveraging these filters, you create a dynamic backup process that adapts to changing data landscapes without manual intervention.

Validating Your Backup Integrity

Once the transfer is complete, verification is essential to ensure that no files were corrupted or missed during the process. Both rsync and PowerShell provide mechanisms to compare source and destination states. For rsync, running the same command again with the --dry-run flag will show you if any differences remain, confirming that the transfer was idempotent. In PowerShell, you can compare the hash values of source and destination files to guarantee bit-for-bit accuracy. Additionally, checking the file counts and total sizes between source and destination provides a quick sanity check. If the numbers do not match, investigate the excluded patterns to ensure no critical data was inadvertently filtered out. Regular validation builds confidence in your backup strategy and ensures that your partial backups are reliable when you need them most.

Frequently Asked Questions

How do I exclude hidden files during a backup?

In rsync, you can add --exclude='.*' to your command to skip all dotfiles and directories. In PowerShell, use Where-Object { -not $_.PsIsContainer -and -not $_.Attributes.HasFlag([System.IO.FileAttributes]::Hidden) } to filter out hidden items effectively.

Can I resume a failed partial backup?

Yes, rsync supports resuming interrupted transfers automatically due to its delta-transfer algorithm. For PowerShell, you may need to implement custom logic to track completed files or use third-party tools that support checkpointing to avoid re-copying already transferred data.

What happens if the destination directory does not exist?

rsync will create the destination directory if it does not exist, provided you have write permissions. In PowerShell, Copy-Item will fail if the target path does not exist unless you use the -Force parameter or manually create the directory using New-Item beforehand.

Is it safe to overwrite existing files during a partial backup?

Overwriting existing files is generally safe if you are updating a known backup set, but it carries the risk of losing previous versions. It is recommended to maintain versioned backups or use timestamps in your destination filenames to preserve historical data and prevent accidental data loss.

How can I monitor the progress of a large partial backup?

Use the -v (verbose) flag with rsync to see each file being transferred, or combine it with -P to show progress bars for individual files. In PowerShell, you can pipe the output of Copy-Item to Write-Host or use the -Verbose parameter to log progress details to the console.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More