borg-delete(1)

✨ borg-delete(1) ✨

okay bestie, we're doing the borg backup tool today and this one is borg-delete, which is literally the "get it out of my sight" command. deleting repos, deleting archives, deleting vibes. let's go πŸ’…


🌸 NAME 🌸

borg-delete β€” delete an existing repository or archives

like, gone gone. no cap. πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

borg [common options] delete [options] [REPOSITORY_OR_ARCHIVE]
[ARCHIVE...]

πŸ¦‹ DESCRIPTION πŸ¦‹

This command deletes an archive from the repository, or the complete repository if you're feeling dramatic. Either way, it's giving demolition era.

IMPORTANT, FR FR: when you delete archives, the repository disk space is NOT freed until you run borg compact. not me finding out the hard way 😭 the space is still there, just vibing, unusable. so go run compact after, okay?

When you delete a complete repository, the security info and the local cache for it (if any exist) get yeeted too. alternatively you can delete just the local cache with the --cache-only option, or keep the security info around with the --keep-security-info option. so many little switches, obsessed.

When in doubt (and bestie, you should be in doubt, this is a delete command), use --dry-run --list to see what would be deleted. that's your vibe check before you commit to anything. ✨

When you use --stats, you get some stats about how much data was deleted. the "Deleted data" deduplicated size is the most interesting one, because that's literally how much your repository will shrink. πŸ“‰ please note that the "All archives" stats refer to the state after deletion β€” so, post-glow-up numbers. also --stats can be slow, so if you want something faster, use --quick-stats (it skips the repository-wide "All archives" statistics). heads up though: --stats / --quick-stats and --dry-run are mutually exclusive, you cannot have both, pick a lane queen πŸ’…

You can delete multiple archives by specifying a shell pattern to match multiple archives using the --glob-archives GLOB option (for more info on these patterns, see borg_patterns). matching multiple things at once? slay. scary? also yes.

To avoid accidentally deleting archives (especially when you're out here using glob patterns, which is such a dangerous game), it might be helpful to use --dry-run to test out the command without actually making any changes to the repository. the way that --dry-run has your back 🫢


🌈 OPTIONS 🌈

See borg-common(1) for common options of Borg commands. (those are the shared ones, we're just doing the delete-specific ones here)

πŸ’– arguments πŸ’–

  • REPOSITORY_OR_ARCHIVE β€” the repository or the archive you want to delete
  • ARCHIVE β€” archives to delete (yep, plural, you can list more than one)

⭐ options ⭐

  • -n, --dry-run β€” do not change repository. it's a pretend delete, a dress rehearsal, a "what if" πŸŽ€
  • --list β€” output verbose list of archives
  • -s, --stats β€” print statistics for the deleted archive
  • --quick-stats β€” print only deletion statistics, skipping repository-wide statistics. the fast version, for when you don't have all day
  • --cache-only β€” delete only the local cache for the given repository
  • --force β€” force deletion of corrupted archives. use --force --force in case --force does not work. yes bestie, that's real, you double the force when one force isn't forcing πŸ’€
  • --keep-security-info β€” keep the local security info when deleting a repository
  • --save-space β€” work slower, but using less space. trading time for disk, the eternal bargain
  • -c SECONDS, --checkpoint-interval SECONDS β€” write checkpoint every SECONDS seconds (Default: 1800)

🧚 Archive filters 🧚

  • -P PREFIX, --prefix PREFIX β€” only consider archive names starting with this prefix. (deprecated β€” so like, it's old, it's tired, use the glob instead πŸ™ˆ)
  • -a GLOB, --glob-archives GLOB β€” only consider archive names matching the glob. sh: rules apply (without actually using the sh: prefix), see "borg help patterns".
  • --sort-by KEYS β€” Comma-separated list of sorting keys; valid keys are: timestamp, archive, name, id; default is: timestamp
  • --first N β€” consider first N archives after other filters were applied
  • --last N β€” consider last N archives after other filters were applied

πŸ”₯ EXAMPLES πŸ”₯

# delete a single backup archive:
$ borg delete /path/to/repo::Monday
# actually free disk space:
$ borg compact /path/to/repo

# delete all archives whose names begin with the machine's hostname followed by "-"
$ borg delete --glob-archives '{hostname}-*' /path/to/repo

# delete all archives whose names contain "-2012-"
$ borg delete --glob-archives '*-2012-*' /path/to/repo

# see what would be deleted if delete were run without --dry-run
$ borg delete --list --dry-run -a '*-May-*' /path/to/repo

# delete the whole repository and the related local cache:
$ borg delete /path/to/repo
You requested to completely DELETE the repository *including* all archives it contains:
repo                                 Mon, 2016-02-15 19:26:54
root-2016-02-15                      Mon, 2016-02-15 19:36:29
newname                              Mon, 2016-02-15 19:50:19
Type 'YES' if you understand this and want to continue: YES

see that last one? it literally makes you type YES in all caps. it's asking you to mean it. main character energy, honestly πŸ‘‘


πŸ‘‘ SEE ALSO πŸ‘‘

borg-common(1), borg-compact(1)

(run the compact one after, for real, your disk space is waiting bestie)


πŸ’œ Author πŸ’œ

The Borg Collective


<div align="center">✨ that's the whole page, no notes ✨</div>

okay so this was from the borg backup tool, dated 2026-07-18, and it's borg-delete(1) β€” go forth and delete responsibly, queen πŸ«ΆπŸ’–πŸŒΈ

πŸ“¦ where this page comes from