BUPSTASH-RESTORE(1)
β¨ BUPSTASH-RESTORE(1) β¨
okay so this is a page from the General Commands Manual and honestly bestie, it's a whole vibe β we're out here making a directory literally identical to a snapshot, and doing it the efficient way π
π SYNOPSIS π
Efficiently restore the contents of a snapshot into a local directory.
bupstash restore [OPTIONS] --into $PATH QUERY...
πΈ DESCRIPTION πΈ
So bupstash restore does a whole efficient set of incremental changes to a directory until it becomes identical to the snapshot you asked for. The incremental thing is the moment β it's literally what makes this command perfect for cycling between a bunch of similar snapshots, like a slideshow of your filesystem π¦
β οΈ okay but real talk β this operation is dangerous. It deletes extra files that are already hanging out in the destination directory. Like, gone gone. No cap. π
Now, because the unprivileged girlies need to be able to browse their own files, bupstash restore does not try to restore users, groups and xattrs by default (it's giving considerate π). To set those you gotta explicitly pass the flags --ownership and --xattrs respectively.
The item that gets checked out is chosen based on a simple query against the tags you specified when you saved your data with bupstash put. cute, right?
π¦ QUERY LANGUAGE π¦
For the full documentation on the query language, go see bupstash-query-language(7). she's the main character of that page, iykyk β¨
π«Ά QUERY CACHING π«Ά
The restore command uses the same query caching mechanisms as bupstash-list(1) β so check that page for more info on the query cache. no need to reinvent the wheel bestie π
π SPARSE FILES π
If a file was detected as sparse during put, then the restore command will restore it as sparse. But β and this is the plot twist β it should be noted that the restore command will not delete an existing file with the correct checksum in order to recreate it as sparse. So if you already got that file, it stays exactly as it is π
π OPTIONS π
--into PATHβ the directory to restore files into. Defaults toBUPSTASH_RESTORE_DIR, so if you set that, you're already slaying.-r,--repository REPOβ the repository to connect to. May be of the formssh://$SERVER/$PATHfor remote repositories, if ssh access is configured. If not specified, it's set toBUPSTASH_REPOSITORY.-k,--key KEYβ the key that will be used to decrypt data and metadata. If not set, it defaults toBUPSTASH_KEY. π--pick PATHβ pick a sub-directory of the snapshot to restore. like choosing your fave slice π--ownershipβ set uid's and gid's. yes, for real.--xattrsβ set xattrs.--indexer-threads Nβ number of processor threads to use for pipelined parallel file hashing and metadata reads. Defaults to the number of processors. the more the merrier, fr fr π₯--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.qcacheor$HOME/.cache/bupstash/bupstash.qcache.--utc-timestampsβ display and search against timestamps in utc time instead of local time. timezone girlies, this one's for you π--no-progressβ suppress progress indicators (progress indicators are also suppressed when stderr is not an interactive terminal). so it's quiet either way, iconic.-q,--quietβ be quiet, and it implies--no-progress. shhh π€«
πΊ ENVIRONMENT πΊ
BUPSTASH_REPOSITORYβ the repository to connect to. May be of the formssh://$SERVER/$PATHfor remote repositories if ssh access is configured.BUPSTASH_REPOSITORY_COMMANDβ a command to run to connect to an instance ofbupstash-serve(1). This allows more complex connections to the repository for less common use cases. fancy πBUPSTASH_KEYβ path to the 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 ofBUPSTASH_KEYto fetch the key from arbitrary locations such as the network or other secret storage. spy vibes π΅οΈBUPSTASH_QUERY_CACHEβ path to the query cache file to use.BUPSTASH_RESTORE_DIRβ path to restore into, can be used instead of the--intoargument.
β EXAMPLES β
π Restore a snapshot into a local directory
$ bupstash restore --into ./dir id=ad8*
π Restore including users and groups
$ bupstash restore --ownership --into ./dir id=ad8*
π Restore a sub directory of the snapshot
$ bupstash restore --into ./dir --pick sub/dir id=ad8*
π SEE ALSO π
bupstash(1), bupstash-get(1), bupstash-list(1), bupstash-keyfiles(7), bupstash-query-language(7)
okay that's the whole page bestie, go forth and restore responsibly π«Άβ¨ this iconic little number is from the General Commands Manual, dated May 2025 β luv ya, bye ππΈ
π¦ 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