Simple package for backups and recovery
Project description
PatronX
PatronX is a lightweight toolkit for PostgreSQL backups, point‑in‑time recovery and object‑storage offloading. The project is written in modern typed Python and ships with a clean command‑line interface.
Features
- Simple CLI for backup, restore and listing available dumps
- Scheduled backups via cron expressions
- Optional upload to S3 for off‑site storage
- Typed Python code with unit tests
DB
- postgres >= 16
pip install -e . # to install in editable mode
patronx --version
patronx list
patronx check-db
patronx backup [--plain] [--no-progress]
patronx restore --inp /path/to/backup.dump [--plain] [--no-progress]
patronx server
patronx enqueue-backup # with remoulade and rabbitmq
The server command starts schedulers that enqueue backup and cleanup jobs
periodically. The backup schedule is controlled via the BACKUP_CRON
environment variable while cleanup uses CLEANUP_CRON. Both take standard
cron expressions. When unset they default to running once per day for backups
and at 1AM for cleanup. Old backups are removed according to the number of days
specified in RETENTION_DAYS (defaults to 30).
AWS configuration
Set the following variables so AwsAssetStore can authenticate using the
s3-uploader-luxoai IAM user:
AWS_ACCESS_KEY_ID
Access key for the IAM user.
AWS_SECRET_ACCESS_KEY
Secret key for the IAM user.
AWS_REGION
Region where the bucket resides.
Test
pytest
Linting and Formatting
ruff check . --fix
isort .
Generate requirements
pip install pip-tools
pip-compile --output-file=requirements.txt pyproject.toml
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 patronx-2.0.0.tar.gz.
File metadata
- Download URL: patronx-2.0.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
551d85510bd6b3d13fa069afb04e5800c1473802b379ff9e25b2db3495f0ce22
|
|
| MD5 |
317495af2eb662bd8ef2965f4c1b6602
|
|
| BLAKE2b-256 |
a49511ad0d3e92b2bd70ffcc1a91363554759ab17e490a7a8d28a29fccbb6246
|
Provenance
The following attestation bundles were made for patronx-2.0.0.tar.gz:
Publisher:
cd-publish-to-pypi.yml on xdanielsb/patronx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patronx-2.0.0.tar.gz -
Subject digest:
551d85510bd6b3d13fa069afb04e5800c1473802b379ff9e25b2db3495f0ce22 - Sigstore transparency entry: 245624000
- Sigstore integration time:
-
Permalink:
xdanielsb/patronx@0674c9bb13aa3b00c64dad2ac7592eb3d2d27779 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/xdanielsb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish-to-pypi.yml@0674c9bb13aa3b00c64dad2ac7592eb3d2d27779 -
Trigger Event:
release
-
Statement type:
File details
Details for the file patronx-2.0.0-py3-none-any.whl.
File metadata
- Download URL: patronx-2.0.0-py3-none-any.whl
- Upload date:
- Size: 11.6 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 |
38071daa1283188a620047f8c7bd6e72f679a419ed4e0e4d29c8b9793d1ca21c
|
|
| MD5 |
c0edc09a1f9b50b73800ef7c6158d803
|
|
| BLAKE2b-256 |
722d0756c12912686d38d21ee9abd20e7ad15ffa4f545a437c84047a42c3d6ee
|
Provenance
The following attestation bundles were made for patronx-2.0.0-py3-none-any.whl:
Publisher:
cd-publish-to-pypi.yml on xdanielsb/patronx
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
patronx-2.0.0-py3-none-any.whl -
Subject digest:
38071daa1283188a620047f8c7bd6e72f679a419ed4e0e4d29c8b9793d1ca21c - Sigstore transparency entry: 245624003
- Sigstore integration time:
-
Permalink:
xdanielsb/patronx@0674c9bb13aa3b00c64dad2ac7592eb3d2d27779 -
Branch / Tag:
refs/tags/2.0.0 - Owner: https://github.com/xdanielsb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd-publish-to-pypi.yml@0674c9bb13aa3b00c64dad2ac7592eb3d2d27779 -
Trigger Event:
release
-
Statement type: