Skip to main content

Airflow operators to backup and restore data using restic

Project description

Restic Airflow

PyPI version PyPI - Python Version PyPI - Downloads License Build Status

Introduction

This repository provides Apache Airflow operators for managing Restic backups. It allows you to integrate Restic backup operations into your Airflow DAGs using Docker-based operators.

Features

  • Docker-based Restic operators for Airflow
  • Support for S3 and local repositories
  • Built-in notification system for task/DAG success and failure
  • Configurable backup retention policies
  • Repository health checking capabilities

Available Operators

  • ResticInitOperator: Initialize a new Restic repository
  • ResticBackupOperator: Create backups with configurable tags and paths
  • ResticForgetAndPruneOperator: Manage backup retention and cleanup
  • ResticCheckOperator: Verify repository integrity
  • ResticUnlockOperator: Remove stale repository locks
  • ResticPruneOperator: Clean up unused data
  • ResticRepositoryExistsOperator: Check if a repository exists

Usage Example

from airflow import DAG
from restic_airflow.operators.restic import ResticBackupOperator

with DAG('backup_dag', ...) as dag:
    backup_task = ResticBackupOperator(
        task_id='backup_data',
        repository='/path/to/repo',
        backup_from_path='/data/to/backup',
        cache_directory='/tmp/restic-cache',
        tags=['daily'],
        password='your-repository-password',
        hostname='backup-host'
    )

See sample.py for a complete DAG example including initialization, backup, health checks, and retention management.

Environment Variables

The operators support configuration through environment variables:

  • RESTIC_PASSWORD: Repository password
  • AWS_ACCESS_KEY_ID: For S3 repositories
  • AWS_SECRET_ACCESS_KEY: For S3 repositories
  • ALERT_EMAIL: Email address for notifications

Notifications

The package includes a notification system that can send emails on:

  • DAG success/failure
  • Individual task success/failure

License

This project is released into the public domain under the Unlicense.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

restic_airflow-0.1.3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

restic_airflow-0.1.3-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file restic_airflow-0.1.3.tar.gz.

File metadata

  • Download URL: restic_airflow-0.1.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for restic_airflow-0.1.3.tar.gz
Algorithm Hash digest
SHA256 22089079089848c1f40ad8a8c04bf91a7f944e2fa4573c3b9cbc83cd1b4ff4f7
MD5 931cbeb09b53e25d8227de78ef14b820
BLAKE2b-256 2179ee089611f4bfea97c9dfa9471f9cf0602cb58372d245766a866d77660a52

See more details on using hashes here.

Provenance

The following attestation bundles were made for restic_airflow-0.1.3.tar.gz:

Publisher: release.yml on jelther/restic-airflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file restic_airflow-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: restic_airflow-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for restic_airflow-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8761383d86664c9d796239f01981bd28bf2ce96f9a7dfb70046cd21fbc5c3308
MD5 826ac163866f7afae21cb63e459783c6
BLAKE2b-256 3a45cca7dbd69612854eb79ec86ba1aec45d700b053ff7451383dc4fa671de68

See more details on using hashes here.

Provenance

The following attestation bundles were made for restic_airflow-0.1.3-py3-none-any.whl:

Publisher: release.yml on jelther/restic-airflow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page