Skip to main content

Piping backup tool wrapped around restic

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trubackup-5.0.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trubackup-5.0.0-py3-none-any.whl (21.5 kB view details)

Uploaded Python 3

File details

Details for the file trubackup-5.0.0.tar.gz.

File metadata

  • Download URL: trubackup-5.0.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for trubackup-5.0.0.tar.gz
Algorithm Hash digest
SHA256 e82a158630f9aa9b487030d1171fe7b88833ed65319ddabbaf19a23a76476ad2
MD5 8f81ce681159a244c32d3f87d8abfe34
BLAKE2b-256 81231d12bcfd614f39bf82078d7c451de19a47f8d626b47eba2186c6b5f9b04a

See more details on using hashes here.

File details

Details for the file trubackup-5.0.0-py3-none-any.whl.

File metadata

  • Download URL: trubackup-5.0.0-py3-none-any.whl
  • Upload date:
  • Size: 21.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for trubackup-5.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0707509d5e03b2aa17581d5bed6cbb52afb4294c279ae8203ab397cf79cb830
MD5 db7c8db39d728c414b0bc2fd729d927c
BLAKE2b-256 83c494661129679bf2a14b43426f86a02827ac32f315513903c55cdaf679108e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page