All Projects → sinnwerkstatt → runrestic

sinnwerkstatt / runrestic

Licence: other
A wrapper script for Restic backup software that inits, creates, prunes and checks backups

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to runrestic

swamp
Navigate your backed up data without drowning.
Stars: ✭ 34 (-58.02%)
Mutual labels:  backups, restic
python-rotate-backups
Simple command line interface for backup rotation
Stars: ✭ 136 (+67.9%)
Mutual labels:  backups
active-monitor
Provides deep monitoring and self-healing of Kubernetes clusters
Stars: ✭ 135 (+66.67%)
Mutual labels:  prometheus-metrics
terraform-aws-backup
Terraform module to provision AWS Backup, a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services such as EBS volumes, RDS databases, DynamoDB tables, EFS file systems, and AWS Storage Gateway volumes.
Stars: ✭ 62 (-23.46%)
Mutual labels:  backups
iTunes Backup Reader
Python 3 Script to parse out iTunes backups
Stars: ✭ 108 (+33.33%)
Mutual labels:  backups
astacus
Clustered database backup
Stars: ✭ 24 (-70.37%)
Mutual labels:  backups
gethexporter
Monitor your Geth Ethereum Server with Prometheus and Grafana
Stars: ✭ 103 (+27.16%)
Mutual labels:  prometheus-metrics
freeradius exporter
FreeRADIUS Prometheus Exporter
Stars: ✭ 25 (-69.14%)
Mutual labels:  prometheus-metrics
prom-bitbucket-exporter
Prometheus Exporter for Bitbucket
Stars: ✭ 47 (-41.98%)
Mutual labels:  prometheus-metrics
macropower-analytics-panel
It's like Google Analytics, but for Grafana dashboards!
Stars: ✭ 16 (-80.25%)
Mutual labels:  prometheus-metrics
jbpm-spring-boot
Sample of a jbpm service with spring boot. It runs on OpenShift and it has prometheus metrics and a grafana dashboard
Stars: ✭ 16 (-80.25%)
Mutual labels:  prometheus-metrics
glouton
Monitoring agent for servers, containers, and applications 🔬
Stars: ✭ 19 (-76.54%)
Mutual labels:  prometheus-metrics
wrapper.py
Wrapper.py is a Minecraft server wrapper that adds additional features to a vanilla server, including backups, dashboard access, plugins, and more.
Stars: ✭ 34 (-58.02%)
Mutual labels:  backups
policy-reporter
Monitoring and Observability Tool for the PolicyReport CRD with an optional UI.
Stars: ✭ 140 (+72.84%)
Mutual labels:  prometheus-metrics
RedArmory
Backup and Restore tool for Bitnami Redmine Stack
Stars: ✭ 15 (-81.48%)
Mutual labels:  backups
grafana-weathermap-panel
plugin weathermap for Grafana. This project is still in development.
Stars: ✭ 27 (-66.67%)
Mutual labels:  prometheus-metrics
bamboo-prometheus-exporter
Prometheus Exporter For Bamboo
Stars: ✭ 18 (-77.78%)
Mutual labels:  prometheus-metrics
bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (-6.17%)
Mutual labels:  backups
minecraft-backup
Backup script for Minecraft servers on Linux. Supports screen, tmux, and RCON connections. Supports tar and restic backup format.
Stars: ✭ 140 (+72.84%)
Mutual labels:  restic
hcloud-pricing-exporter
A prometheus exporter for the current pricing and costs of your HCloud account
Stars: ✭ 19 (-76.54%)
Mutual labels:  prometheus-metrics

python version Code style: black Travis (.com) PyPI Stackshare: runrestic PyPI - Downloads

Runrestic

runrestic is a simple Python wrapper script for the Restic backup software that initiates a backup, prunes any old backups according to a retention policy, and validates backups for consistency. The script supports specifying your settings in a declarative configuration file rather than having to put them all on the command-line, and handles common errors.

Example config

repositories = [
    "/tmp/restic-repo",
    "sftp:user@host:/srv/restic-repo",
    "s3:s3.amazonaws.com/bucket_name"
    ]

[environment]
RESTIC_PASSWORD = "CHANGEME"

[backup]
sources = [
    "/home",
    "/var"
    ]

[prune]
keep-last =  3
keep-hourly =  5

Alternatively you can also just use JSON. For a more comprehensive example see the example.toml or check the schema.json

Getting started

Installing runrestic and restic

To install runrestic, run the following command to download and install it:

sudo pip3 install --upgrade runrestic

You can either manually download and install Restic or you can just run runrestic and it'll try to download it for you.

Initializing and running

Once you have restic and runrestic ready, you should put a config file in on of the scanned locations, namely:

  • /etc/runrestic.toml
  • /etc/runrestic/example.toml
  • ~/.config/runrestic/example.toml
  • /etc/runrestic.json
  • /etc/runrestic/example.json
  • ~/.config/runrestic/example.json

Afterwards, run

runrestic init # to initialize all the repos in `repositories`

runrestic  # without actions will do: runrestic backup prune check
# or
runrestic [action]

Certain `restic` flags like `--dry-run/-n` are built into `runrestic` as well and will be passed to restic where applicable.

If, however, you need to pass along arbitrary other flags you can now add them to the end of your runrestic call like so:

runrestic backup -- --one-file-system

Restic shell

To use the options defined in runrestic with restic (e.g. for a backup restore), you can use the shell action:

runrestic shell

If you are using multiple repositories or configurations, you can select one now.

Prometheus / Grafana metrics

@d-matt created a nice dashboard for Grafana here: https://grafana.com/grafana/dashboards/11064/revisions

systemd timer or cron

If you want to run runrestic automatically, say once a day, the you can configure a job runner to invoke it periodically.

systemd

If you're using systemd instead of cron to run jobs, download the sample systemd service file and the sample systemd timer file. Then, from the directory where you downloaded them:

sudo mv runrestic.service runrestic.timer /etc/systemd/system/
sudo systemctl enable runrestic.timer
sudo systemctl start runrestic.timer

cron

If you're using cron, download the sample cron file. Then, from the directory where you downloaded it:

sudo mv runrestic /etc/cron.d/runrestic
sudo chmod +x /etc/cron.d/runrestic

Changelog

  • v0.5.24

    • Exit the script with returncode = 1 if there was an error in any of the tasks
  • v0.5.23

    • support JSON config files.
  • v0.5.21

    • fix issue where "check" does not count towards overall "errors"-metric
  • v0.5! Expect breaking changes.

    • metrics output is a bit different
    • see new parallel and retry_* options.

Ansible

@tabic wrote an ansible role, you can find it here: https://github.com/outwire/ansible-role-restic . (I have neither checked nor tested it.)

Development

This project is managed with poetry

Install it if not already present:

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
# or
pip install --user poetry

Installing dependencies

poetry install

Running Tests

poetry run pytest

Thanks

This project was initially based on borgmatic but has since evolved into something else.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].