Airflow operators to backup and restore data using restic
Project description
Restic Airflow
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 repositoryResticBackupOperator: Create backups with configurable tags and pathsResticForgetAndPruneOperator: Manage backup retention and cleanupResticCheckOperator: Verify repository integrityResticUnlockOperator: Remove stale repository locksResticPruneOperator: Clean up unused dataResticRepositoryExistsOperator: 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 passwordAWS_ACCESS_KEY_ID: For S3 repositoriesAWS_SECRET_ACCESS_KEY: For S3 repositoriesALERT_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22089079089848c1f40ad8a8c04bf91a7f944e2fa4573c3b9cbc83cd1b4ff4f7
|
|
| MD5 |
931cbeb09b53e25d8227de78ef14b820
|
|
| BLAKE2b-256 |
2179ee089611f4bfea97c9dfa9471f9cf0602cb58372d245766a866d77660a52
|
Provenance
The following attestation bundles were made for restic_airflow-0.1.3.tar.gz:
Publisher:
release.yml on jelther/restic-airflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
restic_airflow-0.1.3.tar.gz -
Subject digest:
22089079089848c1f40ad8a8c04bf91a7f944e2fa4573c3b9cbc83cd1b4ff4f7 - Sigstore transparency entry: 180001304
- Sigstore integration time:
-
Permalink:
jelther/restic-airflow@c359a63900aef88641c07cdac805f6f50e0e0cc5 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/jelther
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c359a63900aef88641c07cdac805f6f50e0e0cc5 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8761383d86664c9d796239f01981bd28bf2ce96f9a7dfb70046cd21fbc5c3308
|
|
| MD5 |
826ac163866f7afae21cb63e459783c6
|
|
| BLAKE2b-256 |
3a45cca7dbd69612854eb79ec86ba1aec45d700b053ff7451383dc4fa671de68
|
Provenance
The following attestation bundles were made for restic_airflow-0.1.3-py3-none-any.whl:
Publisher:
release.yml on jelther/restic-airflow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
restic_airflow-0.1.3-py3-none-any.whl -
Subject digest:
8761383d86664c9d796239f01981bd28bf2ce96f9a7dfb70046cd21fbc5c3308 - Sigstore transparency entry: 180001310
- Sigstore integration time:
-
Permalink:
jelther/restic-airflow@c359a63900aef88641c07cdac805f6f50e0e0cc5 -
Branch / Tag:
refs/tags/0.1.3 - Owner: https://github.com/jelther
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c359a63900aef88641c07cdac805f6f50e0e0cc5 -
Trigger Event:
release
-
Statement type: