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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Exclude machine-local metadata from a backup only when it is unnecessary for recovery and can be reliably regenerated. Caches and temporary files are often reasonable exclusions; configuration, encryption keys, security data, and application state may be essential. Decide by what each item does—not by its filename or where it lives.

What “machine-local metadata” means for a backup

The label does not identify one disposable category. It can refer to caches and runtime files, but also to configuration, keys, security information, or application state. Those items have different recovery value. A path being local to a computer is not, by itself, a reason to omit it.

For each proposed exclusion, ask whether it can be recreated after hardware failure, an operating-system reinstall, or migration; whether it contains settings, identity, access material, keys, or security state; and whether omitting it meaningfully reduces backup work without making recovery incomplete.

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

Which local files are usually safe to exclude?

Known caches and temporary files are the usual candidates when the applications or system can recreate them and they do not contain unique data. Borg’s version 1.4.5 quick-start example excludes cache content and temporary paths while backing up selected system and user directories. It is an example to adapt and test, not a complete operating-system backup.

#1 Best Overall
Sale
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

By contrast, configuration, encryption keys, security data, and application data should not be filtered just because they are stored locally. Work out how each will be recovered. Keys and security state deserve a separate, secure recovery plan; blindly excluding them can leave you unable to access backed-up data or restore a service.

How Borg and restic handle exclusions

Borg: an example, not a universal policy

Borg’s 1.4.5 quick-start example backs up /etc, /home, /root, and /var, while excluding caches and var/tmp. The example is intended to cover important files rather than the entire operating system, and Borg advises adapting and testing it. See the Borg 1.4.5 quick start.

Borg’s documented paths distinguish configuration, cache, data, runtime, key, and security directories. Their locations vary by platform. In the development manual’s Windows description, machine-specific data, cache, and runtime files are in local (non-roaming) AppData, while configuration, including keys, is in roaming AppData. Do not generalize that Windows distinction to other platforms or Borg versions. See Borg’s file-location documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

Restic: understand pattern behavior

Restic supports explicit exclude patterns, pattern files, --exclude-if-present, and a dry run. Its --exclude-caches option excludes the contents of a directory marked by CACHEDIR.TAG but retains the marker. Check the rules for the version you run in the restic 0.19.1 backup documentation.

One important edge case: an exclude pattern does not filter a file or directory that is itself named as a backup source. If you pass a directory as the source, however, patterns can still filter content beneath it. Confirm how your command’s source paths and patterns interact before relying on an exclusion.

Check host identity, filesystems, and changing data

Keep archive naming and pruning aligned

Borg’s example names archives using {hostname}-{now} and scopes pruning to {hostname}-*. The host scope helps prevent pruning one machine’s archives while working on another machine’s archives. Borg also notes that unstable host grouping can prevent it from finding a matching archive when rebuilding its files cache. Keep host identity and archive naming consistent with your recovery plan. See the Borg cache documentation and the quick-start example.

Rank #3
Sale
WD 2TB Elements Portable External Hard Drive for Windows, USB 3.2 Gen 1/USB 3.0 for PC & Mac, Plug and Play Ready - WDBU6Y0020BBK-WESN
  • High capacity in a small enclosure – The small, lightweight design offers up to 6TB* capacity, making WD Elements portable hard drives the ideal companion for consumers on the go.
  • Plug-and-play expandability
  • Vast capacities up to 6TB[1] to store your photos, videos, music, important documents and more
  • SuperSpeed USB 3.2 Gen 1 (5Gbps)

Know what a filesystem boundary excludes

Restic’s --one-file-system prevents traversal into other filesystems and subvolumes. That may also omit mounted media you intended to back up. Borg cautions that device-number checks do not always match mountpoint expectations neatly, so inspect what the backup actually includes rather than assuming a boundary flag has the desired effect.

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

Do not treat every live file as a consistent snapshot

Borg says logs and caches on relatively inactive systems may not be perfectly consistent, but this is rarely a problem. Databases, virtual machines, and containers have distinct consistency requirements; copying their underlying files as ordinary live files may not produce a usable recovery. Use a consistency-appropriate backup method for those workloads. Borg discusses these caveats in its quick start.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify the selection and test recovery

  1. Review the inclusion and exclusion rules. Check that each excluded item is regenerable and that configuration, access material, and unique application data remain recoverable.
  2. Inspect the selected paths. Use the backup tool’s dry-run or listing features where available. For restic, a dry run can help show what the command would select; also verify behavior for explicitly named source paths.
  3. Check filesystem and host boundaries. Confirm mounted media, subvolumes, users, and machine identity are treated as intended, and ensure archive pruning is scoped to the correct host.
  4. Restore representative files. Test recovery of important configuration and data, along with anything needed to regain access. A backup’s contents matter only if you can restore them as expected.
  5. Review retention separately. Borg advises testing that pruning retains and deletes the intended archives. Exclusion rules decide what enters a backup; pruning decides which archives remain.

A sound policy typically excludes only known, regenerable caches and temporary files, explicitly retains the files needed to rebuild the machine, and protects keys and security state through a deliberate recovery process. Revisit the policy when paths, host identity, applications, or backup-tool versions change.

Quick Recap

SaleBestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400)
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.99
Bestseller No. 2
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
SaleBestseller No. 3

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.