Znapper is a tool to help automate zfs snapshot management on larger pools

Related tags

Database znapper
Overview

Znapper - Znap your Snaps

Znapper is a tool to help automate zfs snapshot management on larger pools. This is similar to zfs-auto-snap, but goes a bit further to help manage snapshots over replicated pools for backups within a single host.

Auto snapshot management

To automatically snapshot all pools on your system which have mounted filesystems:

znapper snapshot

To clean-up old automatic snapshots

znapper snapshot_cleanup 
    
    
     
znapper snapshot_cleanup tank 48

    
   

Replication management

This is really what znapper was designed to do. Let's say you have two pools, a smaller nvme pool and a larger disk backed pool named tank.

On the smaller nvme pool, because it's smaller we can not keep as many snapshots due to space limitations. We want to replicate nvme to tank for archival / redundancy, but also to allow extended snapshots to be stored in tank.

To initialise the replication:

znapper init_repl 
    
    
     
znapper init_repl nvme tank/nvme

    
   

To then do an incremental replication

znapper repl 
    
    
     
znapper repl nvme tank/nvme

    
   

How does it work?

The reason auto snapshot only snapshots mounted filesystems is so that any replication target (ie tank/nvme) is NOT snapshot hourly in the background.

This is also why snapshot cleanup requires a pool name, because when snapshots are sent from nvme to tank, we can then cleanup tank/nvme's auto snapshots based on tank's policy which can be longer than the nvme policy.

Replication uses different snapshots as points in times for replication, so even removing all the auto snapshots on either side will NOT break the replication process.

Any replicated filesystem is not mounted and marked as read-only in the process. To restore from one of these snapshots, you can either zfs send back to the original pool, or temporarily mount the fs to manually recover.

Example systemd service files to automate this process.

# zfs-auto-snapshot-hourly.service
[Unit]
Description=ZFS hourly snapshot service

[Service]
Type=oneshot
ExecStart=znapper snapshot
ExecStart=znapper snapshot_cleanup tank 72
ExecStart=znapper snapshot_cleanup nvme 24
zfs-auto-snapshot-hourly.timer
[Unit]
Description=ZFS hourly snapshot timer

[Timer]
OnCalendar=hourly
Persistent=true

[Install]
WantedBy=timers.target
zfs-auto-replicate-daily.service
[Unit]
Description=ZFS daily replicate service

[Service]
Type=oneshot
ExecStart=znapper repl nvme tank/nvme
zfs-auto-replicate-daily.timer
[Unit]
Description=ZFS daily replicate timer

[Timer]
OnCalendar=*-*-* 18:00:00
Persistent=true

[Install]
WantedBy=timers.target
You might also like...
Command-line tool to make Rust source code entities from Postgres tables.

pg2rs Command-line tool to make Rust source code entities from Postgres tables. Generates: enums structs which can be then used like mod structs; use

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD(create/read/update/delete) it using gRPC.

Grsql is a great tool to allow you set up your remote sqlite database as service and CRUD (create/ read/ update/ delete) it using gRPC. Why Create Thi

SQL validator tool for BigQuery standard SQL.

bqvalid What bqvalid does bqvalid is the SQL validator tool for BigQuery standard SQL. bqvalid fails with error message if there's the expression that

A command-line tool for DatPiff Mixtapes
A command-line tool for DatPiff Mixtapes

DatPiff CLI DatPiff CLI helps you browse DatPiff mixtapes right from the terminal. Installation Simply run: $ cargo install datpiff macOS/Linux $ brew

Command-line tool to convert Apple HealthKit data to a SQLite database.

healthkit-to-sqlite Command-line tool to convert Apple HealthKit data to a SQLite database. Getting Started Open the Health app on your iOS device. Cl

A tool to display the minimap of a game larger on a second screen
A tool to display the minimap of a game larger on a second screen

maximap A tool to display the minimap of a game larger on a second screen. Should work on all operating systems supported by captrs and rust_minifb, s

This is a `Rust` based package to help with the management of complex medicine (pill) management cycles.
This is a `Rust` based package to help with the management of complex medicine (pill) management cycles.

reepicheep This is a Rust based package to help with the management of complex medicine (pill) management cycles. reepicheep notifies a person(s) via

Complete code for the larger example programs from the book.

Code Examples for Programming Rust This repository contains complete code for the larger example programs from the book “Programming Rust”, by Jim Bla

Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're working with files or directories, this tool simplifies common file operations with ease.

Rust FileOps Rust File Management CLI is a command-line tool written in Rust that provides essential file management functionalities. Whether you're w

Minimal viable ZFS autosnapshot tool

zfs-autosnap Minimal viable ZFS snapshot utility. Add zfs-autosnap snap to your cron.hourly, and zfs-autosnap gc to cron.daily; then set at.rollc.at:s

An easy-to-use CLI tool to recover files from zfs snapshots

zfs-undelete an easy-to-use cli tool to recover files from zfs snapshots Usage Use zfs-undelete file-to-restore. Works for file and folders. By defa

Mix async code with CPU-heavy thread pools using Tokio + Rayon

tokio-rayon Mix async code with CPU-heavy thread pools using Tokio + Rayon Resources Documentation crates.io TL;DR Sometimes, you're doing async stuff

🐉 Aggregate of Solana stake pools.
🐉 Aggregate of Solana stake pools.

🐉 aSOL: Aggregate Stake Pool aSOL is an unbiased stake pool aggregator built to tackle one goal: to ensure all SOL on Solana is staked into stake poo

Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools.
Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools.

yi Yi Token by Crate Protocol: the primitive for auto-compounding single token staking pools. About Yi is a Solana primitive for building single-sided

A cli tool to automate the building and deployment of Bitcoin nodes
A cli tool to automate the building and deployment of Bitcoin nodes

ℹ️ Automate Bitcoin builds, speed up deployment Shran is an open-source cli tool being developed to address the needs of DMG Blockchain Solutions. It

Tool to automate the visualisation of UML dependencies from a SQL file
Tool to automate the visualisation of UML dependencies from a SQL file

Doteur A simple tool to draw your mysql relations from exports. Help us If you use the tool, and like it, don't forget to add a star to the project on

Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting
Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting

Shellharden is a syntax highlighter and a tool to semi-automate the rewriting of scripts to ShellCheck conformance, mainly focused on quoting

ufo2nft is a CLI Rust tool to automate creating on-chain SVG NFTs from UFO font sources

ufo2nft is a CLI Rust program created by Eli Heuer at the 2022 Seattle Solana Hacker House event. It uses Norad to create on-chain SVG images from UFO font sources, and prepares them for minting as Solana NFTs. For Ethereum NFTs the program can just export the SVGs and Ethereum NFTs can be built manually.

Snapshot testing tool for Nix based on haumea [maintainer=@figsoda]
Snapshot testing tool for Nix based on haumea [maintainer=@figsoda]

namaka Snapshot testing tool for Nix based on haumea nix shell github:nix-community/namaka namaka check # run checks namaka review # review pending sn

Owner
Firstyear
IDM Tech Debt Collector
Firstyear
Tool to help you select inputs for making bitcoin transactions.

BDK Coin Selection bdk_coin_select is a tool to help you select inputs for making Bitcoin (ticker: BTC) transactions. It's got zero dependencies so yo

Bitcoin Dev Kit 5 Dec 5, 2023
CRUD system of book-management with ORM and JWT for educational purposes.

Book management English | 中文 Required Rust MySQL 5.7 Usage Execute init.sql to create tables. Set environment variable DATABASE_URL and JWT_SECRET in

null 32 Dec 28, 2022
ReefDB is a minimalistic, in-memory and on-disk database management system written in Rust, implementing basic SQL query capabilities and full-text search.

ReefDB ReefDB is a minimalistic, in-memory and on-disk database management system written in Rust, implementing basic SQL query capabilities and full-

Sacha Arbonel 75 Jun 12, 2023
CLI tool to work with Sled key-value databases.

sledtool CLI tool to work with Sled key-value databases. $ sledtool --help Usage: sledtool <dbpath> <command> [<args>] CLI tool to work with Sled da

Vitaly Shukela 27 Sep 26, 2022
Rust version of the Haskell ERD tool. Translates a plain text description of a relational database schema to dot files representing an entity relation diagram.

erd-rs Rust CLI tool for creating entity-relationship diagrams from plain text markup. Based on erd (uses the same input format and output rendering).

Dave Challis 32 Jul 25, 2022
Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLite.

Description Simple and handy btrfs snapshoting tool. Supports unattended snapshots, tracking, restoring, automatic cleanup and more. Backed with SQLit

Eduard Tolosa 27 Nov 22, 2022
A cross-platform terminal database tool written in Rust

gobang is currently in alpha A cross-platform terminal database tool written in Rust Features Cross-platform support (macOS, Windows, Linux) Mu

Takayuki Maeda 2.1k Jan 5, 2023
A tool for automated migrations for PostgreSQL, SQLite and MySQL.

Models Models is an implementation for a SQL migration management tool. It supports PostgreSQL, MySQL, and SQLite. Quick Start install the CLI by runn

null 45 Nov 16, 2022
An easy-to-use, zero-downtime schema migration tool for Postgres

Reshape is an easy-to-use, zero-downtime schema migration tool for Postgres. It automatically handles complex migrations that would normally require downtime or manual multi-step changes.

Fabian Lindfors 1.4k Dec 25, 2022
Replibyte - a powerful tool to seed your databases

Seed Your Development Database With Real Data ⚡️ Replibyte is a powerful tool to seed your databases with real data and other cool features ?? Feature

Qovery 3.4k Jan 9, 2023