Skip to main content

trubackup

trubackup is database backup program designed to work with openedx data sources, but not specific to it.

trubackup is a wrapper around restic.

installation

manual

Make sure that you have following software installed in your environment:

  1. Python 3.11

  2. restic

  3. myloader

  4. mongodb-tools

Then, run pip install trubackup==3.1.1.

docker

docker pull trubackup:3.1.1

running

preparations

You need restic repository set up elsewhere for trubackup to operate. Consult restic docs to do it.

Before running trubackup make sure that RESTIC_REPOSITORY and RESTIC_PASSWORD are set.

config

You can use example/trubackup.json in repo as a reference. All the sections are mandatory, but you can set mysql, mongo and s3 to empty list if you don’t want to backup those.

There’s two ways to pass config location to trubackup:

  1. Put it in the TRUBACKUP_CONFIG_PATH environment variable

  2. Pass it as the value of -c or --config command line flag

If neither is used, trubackup will /etc/trubackup.json as fallback.

backup

Run trubackup backup. The last line in it’s output will be backup ID.

list & show

trubackup list and trubackup show are informational commands. You can use the first one to show a list of available backups and the second one to inspect individual backup contents.

restore

Run trubackup restore <BACKUP_ID>. Make sure to replace <BACKUP_ID> with your backup ID.

running regularily

There’s example systemd service & timer in systemd/ directory.

deleting old backups

There’s contrib/delete_old.py script in this repo that will run restic forget command with arguments adjustable by environment variables. Make sure that you read the script before running it. It is destructive.

Metadata

Release files for trubackup 5.0.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 trubackup 5.0.0
File Size Uploaded
trubackup-5.0.0.tar.gz 19.6 kB Details

Built distribution (wheel)

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

Total release size: 41.0 kB

Release files / trubackup-5.0.0.tar.gz

Download URL trubackup-5.0.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e82a158630f9aa9b487030d1171fe7b88833ed65319ddabbaf19a23a76476ad2
BLAKE2b-256 checksum
How to use checksums
81231d12bcfd614f39bf82078d7c451de19a47f8d626b47eba2186c6b5f9b04a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release files / trubackup-5.0.0-py3-none-any.whl

Download URL trubackup-5.0.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b0707509d5e03b2aa17581d5bed6cbb52afb4294c279ae8203ab397cf79cb830
BLAKE2b-256 checksum
How to use checksums
83c494661129679bf2a14b43426f86a02827ac32f315513903c55cdaf679108e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

5.0.0 This release

2 release files

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