Efficiently restore the contents of a snapshot into a local directory.

bupstash restore [OPTIONS] --into $PATH QUERY...


bupstash restore performs an efficient set of incremental changes to a directory such that it becomes identical to the requested snapshot. The incremental nature of bupstash restore makes it well suited for cycling between multiple similar snapshots. Note that this operation is dangerous as it deletes extra files already present in the destination directory.

In order to aid file browsing as unprivileged users, bupstash restore does not attempt to restore users, groups and xattrs by default. To set these you must specify the flags --ownership and --xattrs respectively.

The item that is checked out is chosen based on a simple query against the tags specified when saving data with bupstash put.


For full documentation on the query language, see bupstash-query-language.


The restore command uses the same query caching mechanisms as bupstash-list, check that page for more information on the query cache.


If a file was detected as sparse during 'put', the restore command will restore it as sparse, but it should be noted the restore command will not delete an existing file with the correct checksum in order to recreate it as sparse.


--into PATH

Directory to restore files into, defaults to BUPSTASH_RESTORE_DIR.

-r, --repository REPO

The repository to connect to, , may be of the form ssh://$SERVER/$PATH for remote repositories if ssh access is configured. If not specified, is set to BUPSTASH_REPOSITORY.

-k, --key KEY

Key that will be used to decrypt data and metadata. If not set, defaults to BUPSTASH_KEY.

--pick PATH

Pick a sub-directory of the snapshot to restore.


Set uid's and gid's.


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.

--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.


Display and search against timestamps in utc time instead of local time.


Suppress progress indicators (Progress indicators are also suppressed when stderr is not an interactive terminal).

-q, --quiet

Be quiet, implies --no-progress.



The repository to connect to. May be of the form ssh://$SERVER/$PATH for remote repositories if ssh access is configured.


A command to run to connect to an instance of bupstash-serve. This allows more complex connections to the repository for less common use cases.


Path to the key that will be used for decrypting data and metadata.


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.


Path to the query cache file to use.


Path to restore into, can be used instead of the --into argument.


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*


bupstash, bupstash-get, bupstash-list, bupstash-keyfiles, bupstash-query-language