gitmyhub

sanoid

Perl ★ 3.8k updated 28d ago

These are policy-driven snapshot management and replication tools which use OpenZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.)

Sanoid automatically creates and cleans up ZFS snapshots on a schedule based on a simple config file, so you always have hourly, daily, and monthly recovery points without manual work.

PerlZFSLinuxsetup: moderatecomplexity 3/5

Sanoid is a tool that automatically manages snapshots on ZFS storage systems. A snapshot is a frozen copy of your data at a specific moment in time, which you can use to recover files or roll back an entire system to an earlier state. Without a tool like Sanoid, creating and cleaning up snapshots is a manual process that most people skip, leaving them without backups when something goes wrong.

The way Sanoid works is through a plain-text configuration file where you define policies: how many hourly, daily, weekly, monthly, and yearly snapshots to keep for each storage dataset. Sanoid then runs on a schedule (typically every minute via a system cron job) and handles both creating new snapshots and deleting expired ones according to those policies. The configuration supports templates, so you can define a standard policy once and apply it across many datasets without repeating yourself.

The tool also includes monitoring commands that report on snapshot health and storage pool status, designed to work with Nagios-style monitoring systems. There are optional hooks that let you run your own scripts before or after a snapshot is taken, or when one is pruned, which is useful if you need to quiesce a database or notify another system around snapshot events.

A companion tool called Syncoid handles replication: copying snapshots from one machine or pool to another over SSH. This is how you get offsite or cross-server backups. Syncoid works incrementally, sending only the differences since the last transfer rather than copying everything each time.

Sanoid runs on Linux and requires OpenZFS. The project is free software under the GPL v3 license. The README notes that Btrfs support was previously planned but has been shelved until Btrfs is considered sufficiently reliable. The project is maintained by the author of the Practical ZFS forum and book.

Where it fits