Metadata-Version: 2.4
Name: ezbak
Version: 1.3.1
Summary: A simple tool to backup and restore data as tgz files.
Author: Nate Landau
Author-email: Nate Landau <github@natelandau.com>
License-Expression: MIT
License-File: LICENSE
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: apscheduler>=3.11.3,<4.0.0
Requires-Dist: boto3>=1.43.54,<2.0.0
Requires-Dist: cappa>=0.32.1,<1.0.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: nclutils>=3.4.2,<4.0.0
Requires-Dist: pydantic-settings>=2.14.2,<3.0.0
Requires-Dist: pydantic>=2.13.4,<3.0.0
Requires-Dist: rich>=15.0.0
Requires-Dist: whenever>=0.10.3,<1.0.0
Requires-Python: >=3.11, <3.15
Project-URL: Homepage, https://github.com/natelandau/ezbak
Project-URL: Repository, https://github.com/natelandau/ezbak
Description-Content-Type: text/markdown

[![Tests](https://github.com/natelandau/ezbak/actions/workflows/test.yml/badge.svg)](https://github.com/natelandau/ezbak/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/natelandau/ezbak/graph/badge.svg?token=lR581iFOIE)](https://codecov.io/gh/natelandau/ezbak)

# ezbak

ezbak is a backup manager. It creates, prunes, and restores compressed archives of files and directories on the local filesystem, in AWS S3, or both, with regex file filtering, count-based and time-based retention, and point-in-time restore. It was written primarily to move shared state between jobs and hosts in an orchestrated environment like Nomad or Kubernetes. In that setting the Docker container is the main way to run it; a Python package and a command-line tool run the same backups from your own code or a shell.

ezbak is a small, focused backup manager. It does not aim to replace restic, borg, or a full backup system.

## Documentation

Full documentation lives at **[natelandau.github.io/ezbak](https://natelandau.github.io/ezbak/)**:

- [Quickstart](https://natelandau.github.io/ezbak/getting-started/quickstart/): a first backup in five minutes
- [The orchestration pattern](https://natelandau.github.io/ezbak/orchestration/): backups that follow a job across hosts, with Nomad and Kubernetes examples
- [Configuration reference](https://natelandau.github.io/ezbak/reference/configuration/): every option across the library, CLI, and environment

## Install

```bash
uv add ezbak            # Python package
uv tool install ezbak   # command-line tool
docker pull ghcr.io/natelandau/ezbak:latest   # container
```

ezbak requires Python 3.11 or higher.

## Quickstart

Each interface runs the same backup. Every example below writes a
`my-backup-<timestamp>.tgz` archive to the storage location.

Python:

```python
from ezbak import ezbak

backups = ezbak(name="my-backup", source_paths=["/data"], storage_paths=["/backups"], keep_last=7)
backups.create_backup()
backups.restore_backup(restore_path="/restore")
```

Command line:

```bash
ezbak --name my-backup --storage ~/Backups create --source ~/Documents
```

Container:

```bash
docker run -it \
    -v /path/to/source:/source:ro \
    -v /path/to/backups:/backups \
    -e EZBAK_ACTION=backup \
    -e EZBAK_NAME=my-backup \
    -e EZBAK_SOURCE_PATHS=/source \
    -e EZBAK_STORAGE_PATHS=/backups \
    -e EZBAK_KEEP_LAST=7 \
    ghcr.io/natelandau/ezbak:latest
```

See the [quickstart](https://natelandau.github.io/ezbak/getting-started/quickstart/) for listing and restoring across all three.

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).
