Skip to main content

Tools for managing zfs snapshots

Project description

Sluice is a set of tools for managing ZFS snapshots:

  • zfs-autosnapshot creates snapshots with automatically-generated names

  • zfs-copy combines zfs send and zfs receive

  • zfs-sync does one-way synchronisation of snapshots between two datasets

with several others on the way:

  • zfs-cull

  • zfs-import

  • zfs-export

Motivation / rationale

(combine with description?)

  • goals:

    • unix philosophy

      • snapshot, sync and cull can quite happily be independent operations with separate schedules

    • avoid config file

      • since tools are split up, fewer command-line options are required

      • schedule with cron/launchd and configure targets as args

      • can also use zfs user props for config

    • no requirement for remote installation (provided by weir)

Installation

Requires Python 2.7.

To install Sluice, simply:

$ pip install sluice

Usage

Create a snapshot from a strftime()-compatible date format string:

$ zfs-autosnapshot zroot/test@%Y-%m-%d
$ zfs list -t snapshot -d 1 zroot/test | tail -1
zroot/test@2015-02-10                   0       -   136Ki  -

Create a snapshot from a format string stored in the user property sluice.autosnapshot:format (or the default, %Y-%m-%dT%H%M):

$ zfs set sluice.autosnapshot:format=auto-%Y-%m-%dT%H%M%S zroot/test
$ zfs-autosnapshot zroot/test
$ zfs list -t snapshot -d 1 zroot/test | tail -1
zroot/test@auto-2015-02-10T114854       0       -   136Ki  -

Copy a snapshot:

$ zfs-copy zroot/test@2015-02-10 zroot/test-copy
$ zfs list -t all -r zroot/test-copy
NAME                          USED   AVAIL   REFER  MOUNTPOINT
zroot/test-copy              556Ki  97.0Gi   444Ki  /Volumes/zroot/test-copy
zroot/test-copy@2015-02-10   112Ki       -   136Ki  -

Perform one-way synchronisation between datasets:

$ zfs-sync zroot/test zroot/test-sync
$ zfs list -t all -r zroot/test-sync
NAME                                      USED   AVAIL   REFER  MOUNTPOINT
zroot/test-sync                          136Ki  97.0Gi   136Ki  /Volumes/zroot/test-sync
zroot/test-sync@auto-2015-02-10T114854       0       -   136Ki  -

$ zfs-autosnapshot zroot/test
$ zfs-sync zroot/test zroot/test-sync
$ zfs list -t all -r zroot/test-sync
NAME                                      USED   AVAIL   REFER  MOUNTPOINT
zroot/test-sync                          144Ki  97.0Gi   136Ki  /Volumes/zroot/test-sync
zroot/test-sync@auto-2015-02-10T114854     8Ki       -   136Ki  -
zroot/test-sync@auto-2015-02-10T121006       0       -   136Ki  -

A hold is placed on the source snapshot to prevent inadvertently deleting it and thereby breaking incremental synchronisation:

$ zfs holds zroot/test@auto-2015-02-10T121006
NAME                               TAG                          TIMESTAMP
zroot/test@auto-2015-02-10T121006  sluice.sync:zroot/test-sync  Tue Feb 10 12:10 2015

License

Licensed under the Common Development and Distribution License (CDDL).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sluice-0.2.0.dev.tar.gz (8.7 kB view details)

Uploaded Source

File details

Details for the file sluice-0.2.0.dev.tar.gz.

File metadata

  • Download URL: sluice-0.2.0.dev.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for sluice-0.2.0.dev.tar.gz
Algorithm Hash digest
SHA256 bf8cb8f3adf78d5482f2144673ae52ee929926145d32ab22b0d936ad2f463f69
MD5 b95e79dfc5ddaf0f1555efbd16037423
BLAKE2b-256 d12b738bf5cd591c200fba4f3f4848e9d82f3a11a33ee7f6a8c83c6426322689

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page