BUPSTASH-RM(1)

πŸ“¦
version 0.12.0 Β· 3 versions
, in alpine 3.24

πŸ’… BUPSTASH-RM β€” like, the remove command, bestie

Okay so this is from the General Commands Manual, it's BUPSTASH-RM(1), and it's literally the glow-up-and-get-gone command for your bupstash repo. Sit down, grab a boba, and let's get into it πŸ§‹βœ¨


✨ SYNOPSIS ✨

Remove items from a bupstash repository.

bupstash rm [OPTIONS] QUERY...

🌸 DESCRIPTION 🌸

bupstash rm removes items from a bupstash repository. That's the whole vibe ok πŸ’…

But here's the tea: items that are removed are not immediately deleted. Nope. The deletion and the space reclamation are scheduled for the next time the garbage collector bupstash-gc(1) runs. So think of it like "I unfollowed them but the stories still show up until the app refreshes." Iconic, honestly.

And the best part? Only the metadata needs to be decrypted to remove items, so a metadata key is sufficient for item deletion β€” even if you don't have access to the data decryption key. Security slay πŸ”πŸ‘‘


πŸ¦‹ QUERY LANGUAGE πŸ¦‹

For the full documentation on the query language, go check bupstash-query-language(7) β€” she's the main character of that page.

πŸŽ€ Remove query examples πŸŽ€

$ id=$(bupstash put ./some-data)

$ bupstash rm id=$id

$ bupstash rm name=backups.tar

$ bupstash rm --allow-many name='*.tar' and older-than 30d

$ bupstash rm --allow-many id="*"

Note the --allow-many on the ones that catch more than one item β€” that flag is doing heavy lifting, bestie πŸ‹οΈβ€β™€οΈ


πŸ’œ QUERY CACHING πŸ’œ

The rm command uses the same query caching mechanisms as bupstash-list(1) β€” check that page for more info on the query cache. Shared queen behavior πŸ‘‘πŸ’«


πŸ”₯ OPTIONS πŸ”₯

  • -r, --repository REPO β€” the repository to connect to. May be of the form ssh://$SERVER/$PATH for remote repositories, but only if ssh access is configured. If you don't specify it, it's set to BUPSTASH_REPOSITORY. 🌈
  • -k, --key KEY β€” the key used to decrypt metadata when executing a query. If it's not set, it defaults to BUPSTASH_KEY. πŸ”‘
  • --query-cache PATH β€” path to the query-cache file. Defaults to one of the following, in order, provided the appropriate environment variables are set: $BUPSTASH_QUERY_CACHE, $XDG_CACHE_HOME/.cache/bupstash/bupstash.qcache or $HOME/.cache/bupstash/bupstash.qcache. Chaotic fallback energy but it works πŸ’€
  • --query-encrypted β€” the query will not decrypt any metadata, letting you list items you do not have a decryption key for. This option inserts the pseudo query tag 'decryption-key-id'. Sneaky and useful πŸ•΅οΈβ€β™€οΈ
  • --ids-from-stdin β€” remove items with IDs read from stdin, one per line, instead of executing a query. Pipe girlies rise 🫢
  • --allow-many β€” by default bupstash refuses to remove multiple items from a single query, and this flag disables that safety feature. ⚠️ It's literally a guardrail and you're removing it, so like, be intentional fr fr.
  • --utc-timestamps β€” display and search against timestamps in utc time instead of local time. Timezone girlies stay winning 🌍
  • --no-progress β€” suppress progress indicators (progress indicators are also suppressed when stderr is not an interactive terminal, so it does this automatically, no cap).
  • -q, --quiet β€” be quiet, implies --no-progress. Shhh 🀫

🌼 ENVIRONMENT 🌼

  • BUPSTASH_REPOSITORY β€” the repository to connect to. May be of the form ssh://$SERVER/$PATH for remote repositories if ssh access is configured.
  • BUPSTASH_REPOSITORY_COMMAND β€” a command to run to connect to an instance of bupstash-serve(1). This allows more complex connections to the repository for less common use cases. Fancy πŸ’…
  • BUPSTASH_KEY β€” path to a primary key that will be used for decrypting data and metadata.
  • BUPSTASH_KEY_COMMAND β€” a command to run that must print the key data; can be used instead of BUPSTASH_KEY to fetch the key from arbitrary locations such as the network or other secret storage. So extra, so valid 🌐
  • BUPSTASH_QUERY_CACHE β€” path to the query cache file to use.

πŸ“ EXAMPLES πŸ“

remove an item with a specific id from the repository

$ bupstash rm id=14ebd2073b258b1f55c5bbc889c49db4

remove all items from the respository

$ bupstash rm id="*"
⚠️ Yes, that's all of them. The * is not joking around. Also yes, "respository" is spelled like that in the original and I'm not about to gaslight you about it πŸ™ˆ

remove items with name backup.tar that are older than 30 days

$ bupstash rm name=backup.tar and older-than 30d

remove items with a custom script

$ bupstash list --format=jsonl1 \
   | custom-json-filter \
   | bupstash rm --ids-from-stdin

Pipeline realness πŸ”— β€” bupstash list feeds custom-json-filter feeds bupstash rm --ids-from-stdin, and honestly? Chef's kiss.


⭐ SEE ALSO ⭐

bupstash(1), bupstash-list(1), bupstash-gc(1), bupstash-query-language(7)

Go read bupstash-gc(1) if you actually want that space back btw β€” rm just schedules the deletion, remember? πŸ’€πŸ«Ά


okay that's the whole page, you're officially a bupstash rm expert, periodt πŸ’– This little gem is dated May 2025 and lives in the bupstash source, BUPSTASH-RM(1). Go forth and remove responsibly, bestie πŸŽ€βœ¨

πŸ“¦ where this page comes from