Skip to content

Opinionated set of scripts to automate ZFS snapshots, dataset replication and backups to AWS.

License

Notifications You must be signed in to change notification settings

weak-head/zfs-utils

Repository files navigation

ZFS utils

Opinionated set of scripts to automate ZFS snapshots, dataset replication and backups to AWS.

lint GitHub Release #!/bin/bash MIT License

Table of Contents

Overview

TBD

Getting Started

This project includes several scripts, each with specific dependencies. The only required dependency for all scripts is zfs. Additional dependencies, which depend on the script being used, include pv, aws, and jq.

The scripts' behavior is controlled through ZFS metadata, which determines whether actions like snapshots, replication, or AWS S3 backups should be performed.

Script ZFS Metadata Key Description
zfs-snap zfs-utils:auto-snap Enables automatic snapshots.
zfs-to-s3 zfs-utils:aws-bucket Enables AWS S3 backups.
zfs-to-zfs zfs-utils:replication-target Enables dataset replication.

You can configure ZFS metadata using the zfs set command. Here are some examples:

# Enable automatic snapshots for a dataset
zfs set zfs-utils:auto-snap=true odin/services/cloud

# Configure AWS S3 backups for a dataset
zfs set zfs-utils:aws-bucket=backup.bucket.aws odin/services/cloud

# Define a replication target for a dataset
zfs set zfs-utils:replication-target=thor/services/cloud odin/services/cloud

To install the scripts, run:

# This installs the scripts to `/usr/local/sbin/` 
make install

To view all datasets and their associated metadata, use the zfs-info command.

About

Opinionated set of scripts to automate ZFS snapshots, dataset replication and backups to AWS.

Topics

Resources

License

Stars

Watchers

Forks