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.4.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.4.0
File Size Uploaded Provenance Actions
backfort-1.4.0.tar.gz 93.6 kB With provenance Details for backfort-1.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 159.4 kB

Release files / backfort-1.4.0.tar.gz

Download URL backfort-1.4.0.tar.gz
Size 93.6 kB
Tags Source
SHA-256 checksum
How to use checksums
42c9d24ffd5aa76b5372b278a54e22b027477099812f049eff73349ab20ed80a
BLAKE2b-256 checksum
How to use checksums
fac86fe13c0b19e497ac03cb22a610c89321362777bd3acc59464b614b4466e8
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 26, 2026.

Transparency log

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

Download URL backfort-1.4.0-py3-none-any.whl
Size 65.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fd7ffcc292447931abac2167896b0f2a821da73db6b8bb5a8de771eaef25ae1c
BLAKE2b-256 checksum
How to use checksums
ba1259ef838ac4a5d3ce438024a3d4f271419d6ec395c58f19edc6bc269f36b5
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 26, 2026.

Transparency log

Security for backfort 1.4.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for backfort-1.4.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 26, 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.4.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