Skip to main content

A backup manager using btrfs for incremental local and remote backups

Project description

B4, Better Btrfs Backups

B4 is another tool for creating incremental backups using btrfs subvolumes.

✨ Features

It comes with the following features:

  • Backup remote systems or subvolumes
  • Backup subvolumes inside subvolumes recursively
  • Restore snapshots by replacing or copying them side by side
  • Apply rules which subvolumes to keep and how to restore them
  • Apply rules how long to keep the backups and at which density.

⚡️ Requirements

  • Python 3.12 or higher
  • A btrfs partition on the machine you want to backup and your backup destination.
  • btrfs-progs

🚀 Getting Started

Take a look at the installation page to get started. Once installed, you might take a look at the example use cases to get a starting point.

TODO: Add installation page, if docs deployed

Example

This is just an example to explain the most important features. More examples can be found here: TODO: Add examples docpage

Let's say we want to backup a server with a nextcloud instance on it. The btrfs subvolume we want to backup is /opt/nextcloud. This is where we store all nextcloud-related data.

backup_targets:
  # This is just a name, we want to give our target
  nextcloud.example.com:
    # The location which we want to backup
    source: ssh://root@nextcloud.example.com/opt/nextcloud
    # The location where we want to store the backups.
    # A local path means, that the backups are stored on the same machine as b4.
    destination: /opt/backups
    # In order to be able to send snapshots incrementally, we need to have at least one parent snapshot on source side.
    # Here we can define how many snapshots we want to keep for which amount of time.
    src_retention:
      auto: # You can create multiple rulesets, to be able to handle manual snapshots differently than automatic ones.
        all: "3" # Keep only 3 snapshots on source side
      manual:
        all: "7days" # Keep all snapshots for 7 days on a manual backup
    # The same applies to the destination side.
    dst_retention:
      auto:
        1day: 1month # Keep daily snapshots for 1 month
        1week: 1year # After that remove as many snapshots to only weekly snapshots remain, which are kept fpr a year
        1month: forever # After a year keep snapshots at a monthly interval forever

timezone: utc
# While using the CLI, these are the targets which are used by default.
default_targets:
  - nextcloud.example.com

Documentation

TODO: Deploy docs and update link You can read the undeployed docs in the docs folder.

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

b4_backup-0.1.3.tar.gz (21.8 kB view details)

Uploaded Source

Built Distribution

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

b4_backup-0.1.3-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file b4_backup-0.1.3.tar.gz.

File metadata

  • Download URL: b4_backup-0.1.3.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for b4_backup-0.1.3.tar.gz
Algorithm Hash digest
SHA256 64b1127406bad02bf3ddcdb2a6126ca68091f6f352dec7b0c3144f502789c4f2
MD5 15697671c4d90a567fddfb3203ba4397
BLAKE2b-256 221affb8ec7d77c013a0d5a1ad805029d93e1ec7cdcd8e5b0d55a1edc0e47d45

See more details on using hashes here.

File details

Details for the file b4_backup-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: b4_backup-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 26.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for b4_backup-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 884573ca1b8dcf672d5de082c9744926d2db77ccdc2c22f2adbfa1c725bb1afa
MD5 9ed6989f8fa76a63e977e3b34ec6b309
BLAKE2b-256 c79b7a754ee4b258f4356e93fa5b49091e21f82a46fb9017b4b3487bd11158d9

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