restic #7

Supports: bionic xenial
Add to new model


Charm for the Restic backup utility, allow administrators to define which locations get backed up and the schedule for the backup.


Restic is an open source backup client that runs on Linux. This charm allows users to build a dynamic and platform wide backup schedule that allows for backup to Backblaze (more storage providers coming soon).


To deploy this charm run:

juju deploy ~spiculecharms/restic --to <machine>

Because you're backing up specific servers, deploy the charm to existing machines, don't deploy it to an empty server.

To configure for Backblaze you can do so like this:

juju config restic backup-schedule="<valid crontab>"

juju config restic backup-locations="- hostname1:
      - /my_backup_loc
      - /my_other_backup2
      - /my_last_backup
- hostname2:
      - /location_other"

juju config restic backblaze-account-id=<backblaze id>

juju config restic backblaze-account-key=<backblaze key>

Most of the above is pretty straightforward. You can get your id and key from Backblaze, the crontab is a schedule in cron format for example: "0 5 * * *".

The backuplocations allows you to specify locations on a per server basis whilst still deploying a single Restic Charm.

The YAML looks similar to this:

- hostname1:
      - /my_backup_loc
      - /my_other_backup2
      - /my_last_backup
- hostname2:
      - /location_other

the hostname keys are the server hostsnames. This ensures each server only backs up what its expecting. You then define the bucket you want the backup to go in, and then the paths on the server you want backing up.

Finally, you then need to set the restic repository password on the machines, you can either put a file in /root/.restic-pw or run the action:

juju run-action restic/1 setpassword password="<my restic password>"

This assumes you've already run an init on the bucket prior to configuring restic. If not run something like:

restic -r b2:my-restic-backup init

on a server with Restic installed

Known Limitations and Issues

Currently this charm only supports Backblaze, more backup options to come.

The charm should also implement a backup relation for systems that deal with data, to allow charm authors to define the sensible backup options for databases etc and have Restic automatically backup the data.

Contact Information

W: E:


(string) Backblaze Account ID
(string) Backblaze Account Key
(string) An encoded YAML string, defining backup server hostnames and locations to backup on that server.
(string) When to execute the backup
(string) Backup bucket
(string) DEPRECATED. Use snap-http-proxy and snap-https-proxy model configuration settings. HTTP/HTTPS web proxy for Snappy to use when accessing the snap store.
(string) DEPRECATED. Use snap-store-proxy model configuration setting. The address of a Snap Store Proxy to use for snaps e.g.
(string) How often snapd handles updates for installed snaps. The default (an empty string) is 4x per day. Set to "max" to check once per month based on the charm deployment date. You may also set a custom string as described in the 'refresh.timer' section here: