An open API service indexing awesome lists of open source software.

https://github.com/cego/zfs-cleaner

Tool for destroying ZFS snapshots after predefined retention periods
https://github.com/cego/zfs-cleaner

zfs zfs-autosnapshot-rotation zfs-backup zfs-snapshots

Last synced: 2 months ago
JSON representation

Tool for destroying ZFS snapshots after predefined retention periods

Awesome Lists containing this project

README

          

# WARNING
This is alpha quality software and will probably destroy all your ZFS pools
and kill your dog. Use with caution.

# zfs-cleaner

zfs-cleaner is a simple tool for destroying ZFS snapshots after predefined
retention periods. It aims to do one thing only - and do it well.

## Installation

If you have a working Go environment, it should be as simple as:

go install github.com/cego/zfs-cleaner

### Installation from pre-built package

Binary releases are available here: https://github.com/cego/zfs-cleaner/releases

## Common usage scenario

zfs-cleaner was developed to assist in an environment where ZFS snapshots is
used as backup. Snapshots is transferred to remote hosts. Different
retention policies must be applied to senders and receivers.

A common pattern used at CEGO is having application servers perform ZFS
snapshots often, and use `zfs send` to transfer snapshots to a remote backup
host.

On the application server itself it is often desired to only keep a few
snapshots for space saving. On the receiving backup host, it is often preferred
to have longer retention. zfs-cleaner should solve both cases.

## Configuration

zfs-cleaner is configured through a configuration file resembling the nginx
configuration format without semicolons.

A configuration consists of one or more *plans*. A plan defines how to clean
one or more ZFS datasets.

A plan is defined like this:

plan planA {
path pool/dataset1
path pool/dataset2

keep latest 2

keep 1m for 2h
keep 1h for 2d
}

plan planB {
path pool/dataset3

keep latest 10
protect