---
name: "bupstash-sync"
section: "1"
platform: "linux"
package: "bupstash"
version: "0.12.0-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/bupstash-sync"
---

# bupstash-sync(1)

## SYNOPSIS

Sync items and data from one bupstash repository to another.

**bupstash sync \[OPTIONS\] --to $REMOTE \[QUERY...\]**

## DESCRIPTION

**bupstash sync** copies items and data from one repository to another while attempting to minimize unnecessary bandwidth usage.

A typical use of this command is to backup files to a local repository (e.g. and external drive) while also efficiently uploading them to an offsite location for safe storage.

Note that when no query is specified all items are synced, even those that do not match the current bupstash key.

## QUERY LANGUAGE

For full documentation on the query language, see [bupstash-query-language(7)](/bupstash-query-language/7.md).

## QUERY CACHING

The sync command uses the same query caching mechanisms as [bupstash-list(1)](/bupstash-list/1.md), check that page for more information on the query cache.

## OPTIONS

- \-r, --repository REPO

  The repository to sync from. May be of the form **ssh://$SERVER/$PATH** for remote repositories if ssh access is configured. If not specified, is set to **BUPSTASH\_REPOSITORY**.

- \--to REPO

  The destination repository to sync items to. May be of the form **ssh://$SERVER/$PATH** for remote repositories if ssh access is configured. If not specified, is set to **BUPSTASH\_TO\_REPOSITORY**.

- \-k, --key KEY

  Key used to decrypt metadata when executing a query. If not set, 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**.

- \--query-encrypted

  The query will not decrypt any metadata, allowing you to list items you do not have a decryption key for. This option inserts the pseudo query tag 'decryption-key-id'.

- \--ids-from-stdin

  Sync items with IDs read from stdin, one per line, instead of executing a query.

- \--utc-timestamps

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

- \--no-progress

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

- \-q, --quiet

  Be quiet, implies --no-progress.

## ENVIRONMENT

- BUPSTASH\_REPOSITORY

  The repository to pull items from. 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)](/bupstash-serve/1.md). This allows more complex connections to the repository for less common use cases.

- BUPSTASH\_TO\_REPOSITORY

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

- BUPSTASH\_TO\_REPOSITORY\_COMMAND

  A command to run to connect to an instance of [bupstash-serve(1)](/bupstash-serve/1.md). This allows more complex connections to the repository for less common use cases.

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

- BUPSTASH\_QUERY\_CACHE

  Path to the query cache file to use.

## EXAMPLES

### Push all items from a local repository to a remote repository

```
$ bupstash sync --repository ./local-repository --to ssh://$REMOTE
```

### Perform a backup locally then sync a copy to a remote repository

```
$ export BUPSTASH_REPOSITORY=./local-repository
$ id="$(bupstash put ./some-files)"
$ bupstash sync --to ssh://$REMOTE id="$id"
```

## SEE ALSO

[bupstash(1)](/bupstash/1.md), [bupstash-query-language(7)](/bupstash-query-language/7.md)
