Skip to content

Restic Controller is a program that helps to monitor and manage restic backup repositories.

License

Notifications You must be signed in to change notification settings

tcardonne/restic-controller

Repository files navigation

Restic Controller

Tests, build and publish Go Report Card Docker Pulls

Introduction

Restic Controller is a program that helps to monitor and manage restic backup repositories.

This project has three components :

  • a Prometheus exporter, allowing to scrape metrics via Prometheus,
  • an integrity controller which will check repositories' integrity on a schedule,
  • a retention controller which will apply a given retention policy on a schedule.

With this project, you can use a central location to monitor and manage your repositories.

Get started

Restic Controller is available as a Docker image : tcardonne/restic-controller.

Basic usage :

docker run --rm -it \
    -v "$PWD/config.yml:/app/config.yml" \
    -p "8080:8080" \
    tcardonne/restic-controller

Or, with docker-compose.yml :

version: '3.7'

services:
  controller:
    image: tcardonne/restic-controller:latest
    ports:
      - "8080:8080"
    volumes:
      - "./config.yml:/app/config.yml"

Once started, the controller will run scheduled integrity checks and apply retention policies. Exported metrics are available on the /metrics path.

Configuration

Restic-Controller will, by default, look for a config.yml file in the current working directory.

Full configuration reference available in the config.example.yml file.

Example :

exporter:
  bind_address: ":8080"

repositories:
    - name: "backtothefuture"
      url: "rest:https://user:password@repositories.restic.example/backtothefuture"
      # envFromFile:
      #   RESTIC_REST_USERNAME: /etc/secrets/backtothefuture/username
      #   RESTIC_REST_PASSWORD: /etc/secrets/backtothefuture/password
      password: "password"
      # passwordFile: "/etc/secrets/backtothefuture-repository"
      check:
        schedule: "0 3 * * *"
      retention:
        schedule: "0 4 * * *"
        policy:
          keep_last: 15

This configuration will run integrity checks everyday at 3AM and apply the retention policy at 4AM. The policy will keep the last 15 snapshots.

Grafana & Alertmanager

A Grafana dashboard and a sample Alertmanager rules file are available in the examples/ directory.

Grafana example

License

This project is licensed under BSD 2-Clause License. You can find the complete text in the file LICENSE.

About

Restic Controller is a program that helps to monitor and manage restic backup repositories.

Resources

License

Stars

Watchers

Forks

Packages