Giter VIP home page Giter VIP logo

restic-robot's Introduction

Restic Robot

Backups done right... by robots!

This is a small and simple wrapper application for Restic that provides:

  • Automatically creates repository if it doesn't already exist
  • Scheduled backups - no need for system-wide cron
  • Prometheus metrics- know when your backups don't run!
  • JSON logs - for the robots!

Usage

Just go build and run it, or, if you're into Docker, southclaws/restic-robot.

Environment variables:

  • SCHEDULE: cron schedule
  • RESTIC_REPOSITORY: repository name
  • RESTIC_PASSWORD: repository password
  • RESTIC_ARGS: additional args for backup command
  • RUN_ON_BOOT: run a backup on startup
  • PROMETHEUS_ENDPOINT: metrics endpoint
  • PROMETHEUS_ADDRESS: metrics host:port

Prometheus metrics:

  • backups_all_total: The total number of backups attempted, including failures.
  • backups_successful_total: The total number of backups that succeeded.
  • backups_failed_total: The total number of backups that failed.
  • backup_duration_milliseconds: The duration of backups in milliseconds.
  • backup_files_new: Amount of new files.
  • backup_files_changed: Amount of files with changes.
  • backup_files_unmodified: Amount of files unmodified since last backup.
  • backup_files_processed: Total number of files scanned by the backup for changes.
  • backup_added_bytes: Total number of bytes added to the repository.
  • backup_processed_bytes: Total number of bytes scanned by the backup for changes

It's that simple!

Docker Compose

Stick this in with your other compose services for instant backups!

services:
  #
  # your stuff etc...
  #

  backup:
    image: southclaws/restic-robot
    restart: always
    environment:
      # every day at 2am
      SCHEDULE: 0 0 2 * * *
      RESTIC_REPOSITORY: my_service_repository
      RESTIC_PASSWORD: ${MY_SERVICE_RESTIC_PASSWORD}
      # restic-robot runs `restic backup ${RESTIC_ARGS}`
      # so this is where you specify the directory and any other args.
      RESTIC_ARGS: /data
      B2_ACCOUNT_ID: ${B2_ACCOUNT_ID}
      B2_ACCOUNT_KEY: ${B2_ACCOUNT_KEY}
    volumes:
      # Bind whatever directories to the backup container.
      # You can safely bind the same directory to multiple containers.
      - "/container_data/blog/wordpress:/data/wordpress"

restic-robot's People

Contributors

mlusetti avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.