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
- Host: GitHub
- URL: https://github.com/cego/zfs-cleaner
- Owner: cego
- License: mit
- Created: 2017-04-24T12:15:45.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-12T11:31:39.000Z (over 2 years ago)
- Last Synced: 2024-06-19T06:51:03.383Z (almost 2 years ago)
- Topics: zfs, zfs-autosnapshot-rotation, zfs-backup, zfs-snapshots
- Language: Go
- Size: 94.7 KB
- Stars: 6
- Watchers: 3
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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