Skip to main content

Backfort for Python

Recovery-first Linux backups for files, Docker Compose applications and databases. This distribution bundles Backfort's canonical Bash engine and example YAML; it is a Python launcher, not a Python rewrite or a new backup format.

Requirements

  • Python 3.11+ and Linux. Use WSL or the existing Docker image on Windows.
  • Bash 4.3+, GNU tar, coreutils, findutils, util-linux and gzip.
  • Mike Farah yq v4. The Python package named yq is not compatible.
  • Feature-specific tools such as rclone, age, GPG, Minisign or Docker Compose when the job enables them. Python installation does not install system tools.

Install and run

Install Backfort 1.3.0 with pipx, keeping the launcher isolated:

pipx install 'backfort==1.3.0'
backfort --version

Or install inside a virtual environment:

python3 -m venv .venv
.venv/bin/python -m pip install 'backfort==1.3.0'
.venv/bin/backfort --version
.venv/bin/python -m backfort --help

From a trusted source checkout, replace the install target with .. Do not install into a system-managed Python. For privileged backups, use a protected installation, never a user-writable environment executed as root. No package is downloaded, published or installed system-wide by the Backfort launcher itself.

The installed backfort command and python -m backfort accept the same arguments as backfort.sh. From a checkout, python3 run_backfort.py works without installing the package, including from another working directory. The launcher replaces itself with Bash, preserving arguments, environment, terminal I/O, signals and the engine's exit status. It does not invoke a shell command string, download a script, install dependencies or elevate privileges.

First configuration

Print the bundled reference config to stdout. Choose a new filename: shell redirection overwrites an existing file.

.venv/bin/backfort --print-example-config > backfort.example.yaml

Edit its host ID, source paths, destination paths, encryption and retention before use. Paths are absolute, and backup/state/work directories must stay outside the source tree. Then validate the plan:

.venv/bin/backfort -c "$PWD/backfort.example.yaml" doctor
.venv/bin/backfort -c "$PWD/backfort.example.yaml" --dry-run run
.venv/bin/backfort -c "$PWD/backfort.example.yaml" run
.venv/bin/backfort -c "$PWD/backfort.example.yaml" list

The sole launcher-specific flag is --print-example-config, used alone. All other argument parsing and validation belong to the existing Bash CLI.

Quick backup

.venv/bin/backfort quick /srv/application \
  --name before-upgrade \
  --to /srv/backups/backfort \
  --state-directory /var/lib/backfort \
  --exclude '*.log'

The execution account needs access to those paths. Quick mode saves a non-secret recovery config in the chosen state directory. Use a saved YAML job for encryption, signing, lifecycle hooks and Prometheus textfile metrics.

Verify and recover

.venv/bin/backfort -c /etc/backfort/config.yaml \
  verify latest --job application --full
.venv/bin/backfort -c /etc/backfort/config.yaml \
  restore latest --job application --to /srv/empty-recovery

Adapt the job name. Recovery requires a new or empty target and the necessary keys. Preserve the original host_id for automatic latest discovery, or deliberately select a full backup ID. Full ownership/ACL/xattr recovery needs the same privileges and filesystem support as the native Bash installation.

Exit codes remain 0 success, 1 partial copies, 2 invalid input or prerequisites, and 3 an operational/copy-policy failure. Launcher errors also return 2. Pruning is a separate command; backup creation does not prune.

Learn more

Metadata

Release files for backfort 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for backfort 1.3.0
File Size Uploaded Provenance
backfort-1.3.0.tar.gz 93.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for backfort 1.3.0
File Interpreter ABI Platform
backfort-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 159.0 kB

Release files / backfort-1.3.0.tar.gz

Download URL backfort-1.3.0.tar.gz
Size 93.2 kB
Tags Source
SHA-256 checksum
How to use checksums
61be7c6484c6ecfbff8eecd44f6a98011ffcdd3afe52b4815ecb1472712b25d7
BLAKE2b-256 checksum
How to use checksums
b8b498b3745bd3dc6ff351005ab0b788e0ecae9c5a1d9485d09465725861439c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / backfort-1.3.0-py3-none-any.whl

Download URL backfort-1.3.0-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d8ab3812b17a62e1b25f7f42ed8ed10ff605759106c1c2ac8dc09e996189e86f
BLAKE2b-256 checksum
How to use checksums
9d5833e2fb4adedc669a18b9959b4b7fa403cfd845ab92997fba21a6e06a4fd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for backfort 1.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for backfort-1.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page