Skip to content

dom-53/backupctl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧱 backupctl Suite — Backup system with Prometheus integration

This repository contains two main components:

Name Description
backupctl A standalone Python tool for backing up directories, compression, encryption, and offsite upload.
backupctl-exporter A Dockerized Prometheus exporter that reads backup metadata from a SQLite database and exposes metrics at /metrics.

📦 Project structure

backupctl/
├─ backup/                # main tool
│  ├─ backupctl.py
│  ├─ config/config.yml
│  ├─ data/backupctl.sqlite
│  ├─ secrets/secret.pass
│  ├─ install.sh
│  └─ README_backupctl.md
│
├─ exporter/              # Prometheus exporter
│  ├─ backup_exporter.py
│  ├─ Dockerfile
│  ├─ docker-compose.yml
│  └─ README_backupctl_exporter.md
│
└─ backupctl-grafana-dashboard.json

✨ Key features

backupctl

  • Compression to .tar.zst (Zstandard)
  • Optional encryption (openssl / age)
  • Offsite upload via rclone
  • Scheduled runs (cron / systemd)
  • Retention by count, age, and first-of-month
  • YAML configuration (config.yml)
  • Dual logging (INFO and DEBUG logs)
  • Run metadata stored in SQLite (data/backupctl.sqlite)
  • Parallel runs (--max-parallel)
  • Prometheus integration

backupctl-exporter

  • Exports metrics for Prometheus
  • Grafana dashboard provided (backupctl-grafana-dashboard.json)
  • Visualizations:
    • OK/FAIL runs
    • Trend of size and duration
    • Last timestamp and retention
    • Histograms (duration, output size)

🚀 Quick start

1️⃣ Install backupctl

sudo git clone https://gitlab.com/dom53/backupctl.git /opt/backupctl
cd /opt/backupctl
sudo ./install.sh
sudo python3 /opt/backupctl/backup/backupctl.py --config /opt/backupctl/backup/config/config.yml list

2️⃣ Run the exporter

cd /opt/backupctl/exporter
docker compose up -d --build

3️⃣ Prometheus configuration

scrape_configs:
  - job_name: "backupctl"
    static_configs:
      - targets: ["backupctl-exporter:9799"]

4️⃣ Grafana dashboard

Import the file:
📈 backupctl-grafana-dashboard.json


📜 License

Backupctl is licensed under the Apache License 2.0 © dom53 (2025). All parts of the project (backupctl, exporter, config, tests) are open-source and may be used, modified, and distributed under the terms of this license.

About

backupctl – a simple and robust Python backup tool Automated .tar.zst backups with YAML configuration, retention, encryption, and offsite upload via rclone. Includes an interactive menu, backup restoration, and logging for everyday server use.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages