BUPSTASH-QUERY-LANGUAGE(7)
โจ SYNOPSIS โจ
okay so this is the bupstash-query-language(7) page from the Miscellaneous Information Manual, and itโs literally all about the bupstash query language used by bupstash commands ๐
๐ฆ DESCRIPTION ๐ฆ
The bupstash query language is what you use to filter and select items from a bupstash repository. Bestie, check the examples section for practical uses, or read the language section for a more precise description. Both are valid, both are slay โจ
๐ EXAMPLES ๐
๐ธ Glob matching
$ bupstash list name="*.tar"
... name=foo.tar
... name=bar.tar
๐ Literal matching
$ bupstash list name=="*.tar"
...
๐ฐ๏ธ Age based matching
$ bupstash list newer-than "1 month"
$ bupstash list older-than 2d
$ bupstash list older-than 1y
...
๐ฅ And condition matching
$ bupstash list type=backup and hostname=server1 hostname=server2
...
๐ Or condition matching
$ bupstash list hostname=server1 or hostname=server2
...
๐ง Precedence grouping
$ bupstash list [hostname=server1 or hostname=server2] and date=2020-*
...
๐ Quote using your shellโs builtin quoting
$ bupstash rm name="my files.tar"
๐ LANGUAGE ๐
๐ซถ Delimiters
Queries can span multiple command-line arguments, so the gap between arguments is treated as a special delimiting character for the sake of query parsing. iykyk ๐ซถ
๐ผ Tags and values
A tag name is a string containing a set of characters matching the regular expression [A-Za-z0-9-_]+.
A value is a set of any characters except a delimiter.
โณ Durations
A duration is a concatenation of time spans, where each time span is an integer number and a suffix.
Supported suffixes:
seconds,second,sec,sminutes,minute,min,mhours,hour,hr,hdays,day,dweeks,week,wmonths,month,Mโ defined as30.44 daysyears,year,yโ defined as365.25 days
๐ฆ Globbing
Some operators accept a glob to match against, and the following describes the valid globbing meta characters:
?matches any single character. (If theliteral_separatoroption is enabled, then?can never match a path separator.)*matches zero or more characters. (If theliteral_separatoroption is enabled, then*can never match a path separator.)**recursively matches directories but are only legal in three situations. First, if the glob starts with**/, then it matches all directories. For example,**/foomatchesfooandbar/foobut notfoo/bar. Secondly, if the glob ends with/**, then it matches all sub-entries. For example,foo/**matchesfoo/aandfoo/a/b, but notfoo. Thirdly, if the glob contains/**/anywhere within the pattern, then it matches zero or more directories. Using**anywhere else is illegal (N.B. the glob**is allowed and means โmatch everythingโ).{a,b}matchesaorbwhereaandbare arbitrary glob patterns. (N.B. Nesting{...}is not currently allowed.)[ab]matchesaorbwhereaandbare characters. Use[!ab]to match any character except foraandb.- Metacharacters such as
*and?can be escaped with character class notation. e.g.,[*]matches*. - When backslash escapes are enabled, a backslash (
\) will escape all meta characters in a glob. If it precedes a non-meta character, then the slash is ignored. A\\will match a literal\\. Note that this mode is only enabled on Unix platforms by default, but can be enabled on any platform via thebackslash_escapesetting onGlob.
(Documentation taken from the underlying glob software library https://docs.rs/globset/0.4.8/globset/index.html#).
๐งฎ Binary operators
Check a tag matches a glob:
TAGNAME = GLOB
Check a tag matches a literal value:
TAGNAME == VALUE
Match if either expression matches:
EXPR or EXPR
Match if both expressions match:
EXPR and EXPR
๐ฐ๏ธ Age matching
older-than DURATION
newer-than DURATION
โ ๏ธ bestie, take care that system clocks are configured correctly on both the querying machine and devices sending backups, because incorrect system clocks could cause accidental removal of items ๐ญ
๐ซ Unary operators
Invert an expression:
~ EXPR
๐ซถ grouping
Use brackets to alter the default precedence:
[ EXPR ]
Note: this differs from the typical tradition of using () for grouping so queries are easier to write in shell scripts where () already has a designated meaning.
๐ SEE ALSO ๐
mwah ๐ โ signing off from the bupstash-query-language(7) page (aka BUPSTASH...-LANGUAGE(7)), dated May 2025. stay filtered, bestie ๐ซถโจ
๐ฆ where this page comes from
- alpine 3.24: bupstash-doc 0.12.0-r7 ยท MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms