Skip to content

Setting up Backups with Restic

Restic sends backups to BorgBase over HTTPS and authenticates with a username and password, which are part of the repository URL. Before you start, create a repository with the Restic format and copy its URL from the BorgBase control panel. It starts with rest:https://.

First you need to initialize the repository. This sets up the encryption and writes some supporting files. To avoid passing the repository URL and password with each command, it’s recommended to set it as shell variable:

$ export RESTIC_REPOSITORY=rest:https://xxxxx:yyyyyyyyyyy@xxxxx.repo.borgbase.com
$ export RESTIC_PASSWORD=mysecret

To initialize the repository:

$ restic init

Restic calls each backup run a “snapshot”. It is the state of a specific folder at a specific time. To take a snapshot of folder /var:

$ restic backup /var

Verify our snapshot is there:

$ restic snapshots

You can find more on how to use Restic in the official documentation.