Metadata-Version: 2.4
Name: ezbak
Version: 2.0.0
Summary: Back up and restore files and directories as tar.gz archives on local disks and S3, with retention policies.
Keywords: archive,backup,docker,restore,s3
Author: Nate Landau
Author-email: Nate Landau <github@natelandau.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: POSIX
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Topic :: System :: Archiving :: Backup
Classifier: Typing :: Typed
Requires-Dist: apscheduler>=3.11.3,<4.0.0
Requires-Dist: boto3>=1.44.12,<2.0.0
Requires-Dist: cappa>=0.33.0,<1.0.0
Requires-Dist: loguru>=0.8.0,<1.0.0
Requires-Dist: nclutils>=4.0.0,<5.0.0
Requires-Dist: pydantic-settings>=2.16.3,<3.0.0
Requires-Dist: pydantic>=2.14.4,<3.0.0
Requires-Dist: rich>=15.0.0,<16.0.0
Requires-Dist: whenever>=0.11.0,<1.0.0
Requires-Python: >=3.11
Project-URL: Changelog, https://github.com/natelandau/ezbak/blob/main/CHANGELOG.md
Project-URL: Documentation, https://natelandau.github.io/ezbak/
Project-URL: Homepage, https://github.com/natelandau/ezbak
Project-URL: Issues, https://github.com/natelandau/ezbak/issues
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. It writes them to the local filesystem, to AWS S3, or to both. It filters files with regular expressions, prunes with count-based and time-based rules, and restores a backup from a point in time.

ezbak was written to move shared state between jobs and hosts under an orchestrator such as 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 from a shell.

ezbak stays small and focused. It is not a replacement for 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. A restore needs 3.11.13, 3.12.11, 3.13.4, or later. See [Installation](https://natelandau.github.io/ezbak/getting-started/installation/).

## 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
```

To list and restore backups on all three interfaces, see the [quickstart](https://natelandau.github.io/ezbak/getting-started/quickstart/).

## Contributing

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