bup-gc(1)
π bup-gc β remove unreferenced, unneeded data π
okay bestie, this is a page from the bup(1) manual β specifically bup-gc(1), the one that takes out the trash. let's get into it ποΈβ¨
πΈ SYNOPSIS πΈ
bup gc [-#|--verbose] <branch|save...>
π¦ DESCRIPTION π¦
bup gc removes β like, permanently deletes, no undo, no take-backs β the unreachable data from your repository. this stuff is also called garbage, and it's whatever isn't referred to directly or indirectly by the current set of branches (those are your backup sets, iykyk) and tags. slay, right?
but β and this is the important part, so listen β because of deduplication, deleting a save and then running the garbage collector might or might not actually delete anything, and it might or might not reclaim any space. it's giving "we'll see" π
with the current, probabilistic implementation, some fraction of the unreachable data may be retained. in exchange, the garbage collection should need less RAM than some more precise approaches would need. so like. you win some, you lose some.
typically you'd run the garbage collector after you've run bup rm a bunch of times. that's the whole vibe.
β οΈ WARNING: this is one of the few bup commands that modifies your archive in intentionally destructive ways. (!!!!) that said, if you try to join or restore the data you still care about after a gc and it works, that's a pretty encouraging sign the commands did their job right. the dev/compare-trees command in the source tree can help you test before/after results. π
so how does it work? the collection proceeds by rewriting packfiles to remove unreachable objects, and the new packfiles will respect pack.packSizeLimit β that's documented in bup-config(5). each new packfile will combine content from any number of existing packfiles. iconic.
and when an existing packfile gets removed, any affiliated files (like .idx, .par2, etc.) should also be removed. good news tho: .par2 files can be reestablished by bup-fsck(1). π«Ά
β¨ OPTIONS β¨
--threshold=Nβ only rewrite a packfile if it's over N percent garbage and contains no unreachable trees or commits. if the packfile does contain unreachable trees or commits, it gets rewritten regardless, no matter what the threshold says. the default threshold is10%.-v,--verboseβ turn up the verbosity. and yes bestie, you can give it more than once. π₯-#,--compress=#β set the compression level to #, which is a value from0-9, where9is the highest compression and0is no compression at all. defaults to a configuredpack.compressionorcore.compression, or1(fast, loose compression). this applies to any rewritten packfiles.--ignore-missingβ report missing objects, but don't stop the collection. like, we're noting it, but we're not making it a whole thing.
π EXIT STATUS π
the exit status will be nonzero if there were any errors. and fyi, hitting any missing object counts as an error. so. yeah.
π EXAMPLES π
# Remove all saves of "home" (remove the branch).
$ bup rm home
# Remove two saves from the archives branch.
$ bup rm archives/2025-01-01-030405 archives/2025-10-04-134117
# Remove most of the otherwise unreferenced data.
$ bup gc
π SEE ALSO π
bup-rm(1) and bup-fsck(1) β go read those next, bestie, they're the whole supporting cast.
π§ BUP π§
part of the bup(1) suite. the family. the collective. π
π AUTHORS π
Rob Browning rlb@defaultvalue.org
okay that's the whole page!! tysm for reading, mwah π
β from Bup 0.34, dated 2026-09-01, and it lives in section bup-gc(1). periodt. π
π¦ where this page comes from
- fedora 44: bup 0.34-1.fc44 Β· LGPL-2.0-only
- nixpkgs unstable: bup 0.34
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms