Incremental, multi-version remote backup tool for block devices.

Related tags

Utilities bsync
Overview

bsync

Incremental, multi-version remote backup tool for block devices.

The on-disk backup format is a SQLite database and I've been dogfooding this on my homelab servers for a while, so I consider this quite stable.

Install

bsync implements pull-style synchronization and should be installed on the backup destination (pull-side) host. Get the latest binary from Releases.

The release workflow builds bsync for:

  • Linux (x86_64, binary and .deb)
  • macOS (x86_64, binary)
  • FreeBSD (x86_64, binary)

Usage

bsync works over SSH and pulls changes to a block device from the remote host (backup source). Linux (x86_64, AArch64) is currently the only supported OS on the backup source.

Pull changes (see "Example config" below for an example of config.yaml):

$ bsync pull -c ./config.yaml

List local versions:

$ bsync list --db ./backup.db
+-------+---------------------+
| LSN   | CREATED             |
+=======+=====================+
| 21800 | 2021-10-19 08:21:51 |
+-------+---------------------+
| 22267 | 2021-10-19 08:46:24 |
+-------+---------------------+
| 30245 | 2021-10-20 00:22:38 |
+-------+---------------------+
| 35319 | 2021-10-20 08:22:15 |
+-------+---------------------+

Build an image of the block device at a given point in time:

# Find `lsn` from `bsync list` output
$ bsync replay --db ./backup.db --lsn 30245 --output ./replay.img

Start an NBD server to serve a read-only version of the block device at a given point in time:

$ bsync serve --db ./backup.db --lsn 30245 --listen 127.0.0.1:2939
# Or, to listen on a unix socket
$ bsync serve --db ./backup.db --lsn 30245 --listen unix:/tmp/bsync.sock

Squash the backup to remove historic versions and free up space:

# Remove versions between LSN 21800 and 30245 (boundaries excluded) so that the remaining versions are
# 21800, 30245, 35319
$ bsync squash --db ./backup.db --start-lsn 21800 --end-lsn 30245 

Example config

The schema of the config file is defined as BackupConfig in src/config.rs and can be used as a reference.

Note that bsync doesn't automatically snapshot your volumes yet so please add your own snapshot logic (LVM, zvol, etc.) in remote.scripts.pre_pull to ensure data consistency. An example for backing up LVM thin volumes (taken from my homelab servers):

remote:
  server: 192.168.1.1
  user: root
  image: /dev/mapper/VG_data01-data--auto--snapshot--do--not--touch
  scripts:
    pre_pull: |
      set -e
      lvremove -y VG_data01/data-auto-snapshot-do-not-touch || true
      lvcreate -s VG_data01/data -n data-auto-snapshot-do-not-touch
      lvchange -ay -Ky VG_data01/data-auto-snapshot-do-not-touch
    post_pull: |
      lvremove -y VG_data01/data-auto-snapshot-do-not-touch
local:
  db: /backup/store.db
  pull_lock: /backup/store.lock
You might also like...
A self-contained, single-binary Rust and Leptos application for remote Wake-on-LAN
A self-contained, single-binary Rust and Leptos application for remote Wake-on-LAN

Remote Wake-on-LAN with Rust and Leptos A self-contained, single-binary Rust and Leptos application serving a web interface to wake another device on

mach-dump can parse Mach-O core dumps taken with lldb from macOS and iOS devices.

mach-dump mach-dump can parse Mach-O core dumps taken with lldb from macOS and iOS devices. It has no external dependencies. Example use std::path::Pa

Easily sync your clipboard between devices. This is a work in progress app.

Clipboard Sync Description Easily sync your clipboard between devices. This is a work in progress app. Stack Frontend: React Tauri isomorphic-ws TSX,

Ector is an open source async, no-alloc actor framework for embedded devices

Ector is an open source async, no-alloc actor framework for embedded devices. Ector is an open source async, no-alloc actor framework for embedded dev

Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.
Port of the fantastic Iconoir Icon Pack to Rust embedded devices, with a focus on speed, usability, and completeness.

embedded-iconoir - Icons for every device, ever. What is embedded-iconor? embedded-iconoir is a library that allows you to use Iconoir on embedded dev

A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator
A lightning fast version of tmux-fingers written in Rust, copy/pasting tmux like vimium/vimperator

tmux-thumbs A lightning fast version of tmux-fingers written in Rust for copy pasting with vimium/vimperator like hints. Usage Press ( prefix + Space

A simplified but faster version of Routerify
A simplified but faster version of Routerify

Routerify lite Routerify-lite is a simplified but faster version of Routerify. It only provides below functions: path matching error handling Why not

🦸‍♂️ Recast migrates your old extensions to AndroidX, making them compatible with the latest version of Kodular.
🦸‍♂️ Recast migrates your old extensions to AndroidX, making them compatible with the latest version of Kodular.

Recast Recast helps make your old extensions compatible with Kodular Creator version 1.5.0 or above. Prerequisites To use Recast, you need to have Jav

Rust version of tomnomnom/waybackurls

wayback-rs Rust version of tomnomnom/waybackurls Command line interface for fetching url from Wayback Machine, CommonCrawl, VirusTotal.

Comments
  • Configure Renovate

    Configure Renovate

    Mend Renovate

    Welcome to Renovate! This is an onboarding PR to help you understand and configure settings before regular Pull Requests begin.

    🚦 To activate Renovate, merge this Pull Request. To disable Renovate, simply close this Pull Request unmerged.


    Detected Package Files

    • bsync-transmit/Cargo.toml (cargo)
    • bsync/Cargo.toml (cargo)
    • .github/workflows/ci.yml (github-actions)

    Configuration

    🔡 Renovate has detected a custom config for this PR. Feel free to ask for help if you have any doubts and would like it reviewed.

    Important: Now that this branch is edited, Renovate can't rebase it from the base branch any more. If you make changes to the base branch that could impact this onboarding PR, please merge them manually.

    What to Expect

    With your current configuration, Renovate will create 17 Pull Requests:

    Update Rust crate chrono to 0.4.23
    • Schedule: ["at any time"]
    • Branch name: renovate/chrono-0.x
    • Merge into: main
    • Upgrade chrono to 0.4.23
    Update Rust crate itertools to 0.10.5
    • Schedule: ["at any time"]
    • Branch name: renovate/itertools-0.x
    • Merge into: main
    • Upgrade itertools to 0.10.5
    Update Rust crate structopt to 0.3.26
    • Schedule: ["at any time"]
    • Branch name: renovate/structopt-0.x
    • Merge into: main
    • Upgrade structopt to 0.3.26
    Update Rust crate blake3 to 1.3.1
    • Schedule: ["at any time"]
    • Branch name: renovate/blake3-1.x
    • Merge into: main
    • Upgrade blake3 to 1.3.1
    Update Rust crate indicatif to 0.17.2
    • Schedule: ["at any time"]
    • Branch name: renovate/indicatif-0.x
    • Merge into: main
    • Upgrade indicatif to 0.17.2
    Update Rust crate lru to 0.8.1
    • Schedule: ["at any time"]
    • Branch name: renovate/lru-0.x
    • Merge into: main
    • Upgrade lru to 0.8.1
    Update Rust crate parking_lot to 0.12
    • Schedule: ["at any time"]
    • Branch name: renovate/parking_lot-0.x
    • Merge into: main
    • Upgrade parking_lot to 0.12
    Update Rust crate phf to 0.11
    • Schedule: ["at any time"]
    • Branch name: renovate/phf-0.x
    • Merge into: main
    • Upgrade phf to 0.11
    Update Rust crate prettytable-rs to 0.9
    • Schedule: ["at any time"]
    • Branch name: renovate/prettytable-rs-0.x
    • Merge into: main
    • Upgrade prettytable-rs to 0.9
    Update Rust crate rusqlite to 0.28.0
    • Schedule: ["at any time"]
    • Branch name: renovate/rusqlite-0.x
    • Merge into: main
    • Upgrade rusqlite to 0.28.0
    Update Rust crate serde_yaml to 0.9
    • Schedule: ["at any time"]
    • Branch name: renovate/serde_yaml-0.x
    • Merge into: main
    • Upgrade serde_yaml to 0.9
    Update Rust crate sha2 to 0.10.6
    • Schedule: ["at any time"]
    • Branch name: renovate/sha2-0.x
    • Merge into: main
    • Upgrade sha2 to 0.10.6
    Update Rust crate zstd to 0.11.2+zstd.1.5.2
    • Schedule: ["at any time"]
    • Branch name: renovate/zstd-0.x
    • Merge into: main
    • Upgrade zstd to 0.11.2+zstd.1.5.2
    Update vmactions/freebsd-vm action to v0.3.0
    • Schedule: ["at any time"]
    • Branch name: renovate/vmactions-freebsd-vm-0.x
    • Merge into: main
    • Upgrade vmactions/freebsd-vm to v0.3.0
    Update actions/checkout action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-checkout-3.x
    • Merge into: main
    • Upgrade actions/checkout to v3
    Update actions/download-artifact action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-download-artifact-3.x
    • Merge into: main
    • Upgrade actions/download-artifact to v3
    Update actions/upload-artifact action to v3
    • Schedule: ["at any time"]
    • Branch name: renovate/actions-upload-artifact-3.x
    • Merge into: main
    • Upgrade actions/upload-artifact to v3

    🚸 Branch creation will be limited to maximum 2 per hour, so it doesn't swamp any CI resources or spam the project. See docs for prhourlylimit for details.


    ❓ Got questions? Check out Renovate's Docs, particularly the Getting Started section. If you need any further assistance then you can also request help here.


    This PR has been generated by Mend Renovate. View repository job log here.

    opened by renovate[bot] 0
Owner
Heyang Zhou
I'm interested in both the mathematical and mechanical foundations of computing. Compilers / OS / distributed systems.
Heyang Zhou
A safe sync/async multi-producer, multi-consumer channel

Loole A safe async/sync multi-producer multi-consumer channel. Producers can send and consumers can receive messages asynchronously or synchronously:

Mahdi Shojaee 50 Oct 6, 2023
A super super super voting system on near block chain :)

Disp41r-Super-Voting-System a super super super voting system on near block chain :) Finish! I call it super voting system, because it is really cool!

Disp41r 1 Jan 15, 2022
🌲 Open the current remote repository in your browser

gitweb Some of the flags and options are subject to change in the future. Ideas are welcome. Ideas are bulletproof (V). gitweb is a command line inter

Yoann Fleury 26 Dec 17, 2022
Remote Secret Editor for AWS Secret Manager

Barberousse - Remote Secrets Editor About Usage Options Printing Editing Copying RoadMap 1.0 1.1 Future About A project aimed to avoid downloading sec

Mohamed Zenadi 18 Sep 28, 2021
🚧 (Alpha stage software) Binary that supports remote filesystem and process operations. 🚧

distant Binary to connect with a remote machine to edit files and run programs. ?? (Alpha stage software) This program is in rapid development and may

Chip Senkbeil 296 Dec 28, 2022
Mobile safari / webview remote debugging and e2e testing libraries

Canter (WIP) (WIP) Mobile safari / webview remote debugging and e2e testing libraries. Developed for safari/webview e2e testing on iPhone. Works only

Han Lee 9 Aug 16, 2022
Remoc 🦑 — Remote multiplexed objects and channels for Rust

Remoc ?? — remote multiplexed objects and channels Remoc makes remote interaction between Rust programs seamless and smooth. Over a single underlying

ENQT GmbH 98 Dec 21, 2022
M8 remote display - Rust

RM8 Remote display for the Dirtywave M8 I first tried M8WebDisplay then discovered m8c and decided to use it as a starting point for my own version in

Alex Boussinet 30 Dec 31, 2022
The system for remote workers to prevent their family members from interrupting conference calls

onair The system for remote workers to prevent their family members from interrupting conference calls. The system is designed to automatically detect

Yushi OMOTE 6 Sep 21, 2022
📮 load, write, and copy remote and local assets

axoasset This library offers read, write, and copy functions, for local and remote assets given a string that contains a relative or absolute local pa

axo 7 Jan 25, 2023