Skip to main content

resticbackups3 (rbs3)

A command-line tool that turns restic and S3-compatible storage (Cloudflare R2 first) into "init once, then back up from cron":

rbs3 init <profile>
rbs3 backup <profile> --mail
rbs3 cronjob <profile> "0 4 * * *" --mail --silent

Status: early development. rbs3 init and rbs3 backup work; retention, email reports, restore and cron come next.

Create a profile

rbs3 init <profile> --env-file creds.env --config settings.toml

Credentials can come from an env file (--env-file), this shell's environment (--env-var), flags (--restic-password=…) or prompts. They combine, with flags first, then the env file, then the environment, and anything still missing is asked for. Prefer the env file or the prompts: secrets given as flags end up in shell history.

Key Required
RESTIC_REPOSITORY yes, s3:https://<account>.r2.cloudflarestorage.com/<bucket>[/<prefix>]
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, RESTIC_PASSWORD yes
AWS_DEFAULT_REGION no, default auto
SMTP_SERVER no; empty means no email reports
SMTP_PORT, SMTP_SECURITY (starttls/ssl) defaults 587 / starttls
SMTP_USER, SMTP_PASSWORD, MAIL_TO when SMTP_SERVER is set
MAIL_FROM no, default SMTP_USER

Before saving, init checks everything it can and prints ✔ or ✖ with a reason for each:

  • restic is installed and 0.16 or newer (if not, it prints the install command for your distro);
  • the S3 keys can list, write and delete in the bucket (an R2 token with an IP allow-list is named as such, with this machine's public IP);
  • the repository exists and the password opens it, or, if there is none yet, it offers to create one (--yes creates it without asking);
  • the SMTP login works, if email is configured, and it can send a test email.

If a check fails, nothing is saved unless you answer "save anyway" at the prompt.

Without --config, the settings are asked for one by one. The profile is saved as /etc/resticbackups3/<profile>/.env (root only, 0600) and config.toml (0644). After that you may delete your own copies, but keep RESTIC_PASSWORD in a password manager: without it no backup can be restored.

Back up

rbs3 backup <profile> [--silent] [--dry-run]

All sources go into one snapshot, tagged rbs3 and profile:<profile>. Before it starts, rbs3 removes stale repository locks and opens the repository; afterwards it shows the repository size, the latest snapshot's restore size and the profile's snapshot count. A relative exclude pattern is rooted at each source (thumbs skips <source>/thumbs, **/*.tmp any .tmp file in it); an absolute one is used as-is. If [freshness_check] is set, a stale or missing matching file is reported as a warning.

  • --silent prints nothing but errors; --dry-run shows what would be uploaded.
  • Each run writes /var/log/resticbackups3/<profile>/backup/<time>.txt, with secrets replaced by ***. Logs older than report.log_keep_days are removed.
  • Only one run per profile at a time: a second one exits at once.
  • Exit codes: 0 OK, 3 warning (snapshot made, but some files could not be read), 1 failed, 75 another run of this profile is still going, 130 cancelled.

Install

Needs Linux, Python 3.12 or newer, and restic 0.16 or newer.

Tool Install Update
pipx pipx install resticbackups3 pipx upgrade resticbackups3
uv uv tool install resticbackups3 uv tool upgrade resticbackups3
pip (in a venv) pip install resticbackups3 pip install --upgrade resticbackups3

Run rbs3 as your normal user; it asks for sudo itself when it needs it.

Development

python -m venv .venv && . .venv/bin/activate
pip install -e ".[dev]" ruff mypy
git config core.hooksPath .githooks   # blocks commits containing strings from notes/deny-list.txt
ruff check . && ruff format --check . && mypy && pytest -n auto

tests/test_integration.py runs the checks against a real restic and S3 endpoint when RBS3_IT_ENDPOINT, RBS3_IT_BUCKET, RBS3_IT_KEY and RBS3_IT_SECRET are set. CI starts Versity Gateway for it.

Pull request titles follow Conventional Commits; a merged feat: or fix: publishes a release.

License

MIT

Metadata

Release files for resticbackups3 0.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 resticbackups3 0.3.0
File Size Uploaded Provenance Actions
resticbackups3-0.3.0.tar.gz 64.0 kB With provenance Details for resticbackups3-0.3.0.tar.gz

Built distribution (wheel)

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

Total release size: 144.8 kB

Release files / resticbackups3-0.3.0.tar.gz

Download URL resticbackups3-0.3.0.tar.gz
Size 64.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8ae5996eccd6e16e64d1ee22c99ceb5bdb8f96291a91ff8f4ea7b7bb7c14559f
BLAKE2b-256 checksum
How to use checksums
c9e681b209efcb76d464c0470383e3c9046dded84de375b9ab3a8feed75c1c2f
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 Nov 30, 2026.

Transparency log

Release files / resticbackups3-0.3.0-py3-none-any.whl

Download URL resticbackups3-0.3.0-py3-none-any.whl
Size 80.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8066aab629342ea36c07e6d0850909a6e22d86d1a9d5c2846cb806125ffbb9f
BLAKE2b-256 checksum
How to use checksums
8281d224626ae8076d2e1daa959b52f061ed3aee934eb5757f15c4b568cc0b8d
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 Nov 30, 2026.

Transparency log

Security for resticbackups3 0.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

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

Select from 2 files

Attestation for resticbackups3-0.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 Nov 30, 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.

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