No description
  • Rust 98.8%
  • Shell 1.2%
Find a file
Eduard Tolosa 25192f2e9d
Some checks failed
Rust / build (push) Has been cancelled
(chore): bump version to 0.9.0
2026-08-31 04:05:33 -05:00
.github (ci): build and publish release binaries from GitHub Actions 2026-08-30 16:57:20 -05:00
.vscode (ci): build and publish release binaries from GitHub Actions 2026-08-30 16:57:20 -05:00
docs (docs): add the replication screenshots and the 0.9.0 release notes 2026-08-31 04:05:25 -05:00
examples (docs): document exclude and add the 0.8.0 release notes 2026-08-31 00:14:54 -05:00
images (docs): add the replication screenshots and the 0.9.0 release notes 2026-08-31 04:05:25 -05:00
src (fix): restore to the snapshot source when --to is not given 2026-08-31 03:51:08 -05:00
tests (feat): give each --list table a heading and drop the + from the borders 2026-08-31 03:38:13 -05:00
.gitignore Initial commit. 2021-04-15 21:12:08 -05:00
.rustfmt.toml Add rustfmt 2024-02-05 11:47:43 -05:00
builder.sh (ci): build and publish release binaries from GitHub Actions 2026-08-30 16:57:20 -05:00
Cargo.lock (chore): bump version to 0.9.0 2026-08-31 04:05:33 -05:00
Cargo.toml (chore): bump version to 0.9.0 2026-08-31 04:05:33 -05:00
LICENSE Create LICENSE 2025-05-04 00:33:15 -05:00
README.md (docs): add the replication screenshots and the 0.9.0 release notes 2026-08-31 04:05:25 -05:00

Description

Simple and handy definitions-based snapshotting tool for BTRFS. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.

Documentation

See the docs folder.

Features

The main feature of Rustnapshot is the ability to create snapshots of BTRFS subvolumes using simple TOML definitions. It is designed to be simple and easy to use, while still providing powerful features for managing snapshots. See the examples folder for more information.

Among the features of Rustnapshot are:

  • Allows you to specify the origin and destination of snapshots at will of the user.
  • Track snapshots using SQLite as backend database.
  • Easy setup using small templates instead of confusing long files.
  • Ability to create snapshots of the volumes you want simply by using different configuration templates.
  • Ability to create read-only or read-write snapshots.
  • Ability to use the same SQLite database for everything.
  • Ability to specify the prefix of the name for the snapshots for better identification.
  • Ability to specify a kind identifier to differentiate them in the database. Useful if you plan to have hourly, weekly, monthly or more "kind" of snapshots of the same subvolume(s).
  • Ability to specify the maximum number of snapshots to keep for automatic cleanup.
  • Supports restoration of snapshots in the original directory or a specific one.
  • Supports machine name identification for better tracking when using the same database in multiple machines. Automatic cleanup only touches the snapshots of the machine running it.
  • Replication to another disk or machine with btrfs send/receive (--send): incremental, with its own retention at the target.
  • --dry-run to see what would be created, deleted, restored or sent without touching anything.
  • Nice CLI output to see the status and details of snapshots.

Known limitations

Due to SQLite limitations to handle concurrent database operations, we need to make use of SQLite's busy_timeout, which was initially implemented in ce44bf6. Without it you will get the error: Error: database is locked (code 5) if you try to make concurrent snapshots exactly at the same time. The default timeout is 10 seconds which is more than enough time so that no problem occurs even in the most demanding scenarios.

In summary, busy_timeout is the maximum time that SQLite will retry the failed transaction. Considering that Rusnapshot's database operations are small and shouldn't take long, 10 seconds is a decent time. If you continue to get the mentioned error, try increasing --timeout, remember that the value must be in milliseconds.

Screenshots

Listing snapshots and replicas

Listing snapshots and replicas

Creating and restoring a snapshot

Creating and restoring a snapshot

Replicating to another host

Replicating to another host

Restoring from a replica

Restoring from a replica