Skip to main content

ZFS incremental snapshot dump and restore tool

Project description

PyPI version

Snapdump

This tool is primarily intended to be used to backup zfs servers to foreign file systems with the offsite backup use case in mind. It's intended to be ran from outside the ZFS box, and uses passwordless ssh login to perform zfs operations.

Installation

$ pip install snapdump
$ snapdump  --help
usage: snapdump [-h] [--conf CONF] {backup,restore,list,cleanup} ...

snapdump : backup and restore zfs snapshots to/from a foreign file system

positional arguments:
  {backup,restore,list,cleanup}
                        sub-command help
    backup              Backup
    restore             Restore
    list                Restore
    cleanup             Cleanup old snapshots and dump directories

optional arguments:
  -h, --help            show this help message and exit
  --conf CONF, -c CONF  Config file name

You will need to start by creating a config file, see config.sample.yml for an example.

in addition, you need password-less ssh root access to your server. See restricted_shell/README.md for details about improving security.

Features

  • Incremental snapshot dump and restore
  • Taking zfs snapshots automatically
  • Automatic cleanup of both ZFS znapshots and dumped files

Script is intended to be executed from a cron job, at a high frequency. it will not do anything if the correct interval has not passed.

Commands

backup

backup will create full or incremental snapshots of each dataset mentioend in the config, and will also perform cleanup

$ snapdump -c /path-to-config/config.yml backup
Creating incremental snapshot dump for storage/home@2018_12_14__00_23_58 based on 2018_12_14__00_21_47
Creating incremental snapshot dump for storage/datasets01@2018_12_14__00_23_58 based on 2018_12_14__00_21_47

list

Listing all current snapshots per dataset.

snapdump -c /path-to-config/config.yml list
storage/home:
	= storage/home@2018_12_10__19_20_34
	+ storage/home@2018_12_14__00_21_47
	+ storage/home@2018_12_14__00_23_58
storage/datasets01:
	= storage/datasets01@2018_12_11__04_47_33
	+ storage/datasets01@2018_12_14__00_21_47
	+ storage/datasets01@2018_12_14__00_23_58

Each snapshot is prefixed with = or +, to indicate if it's a full (=) or incremental (+) snapshot.

restore

Restore will take a snapshot name and optionally a destination dataset and restore it. it will work correctly for incremental snapshots as well. if destination dataset name is not provided, a new dataset with the suffix _restore will be created.

$ snapdump -c /path-to-config/config.yml restore -s storage/datasets01@2018_12_14__00_23_58 
Restoring snapshot storage/datasets01@2018_12_14__00_23_58 to storage/datasets01_restore

cleanup

Initiate the cleanup, this is not normally needed because backup is cleaning up automatically

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

snapdump-1.0.6.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

snapdump-1.0.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file snapdump-1.0.6.tar.gz.

File metadata

  • Download URL: snapdump-1.0.6.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for snapdump-1.0.6.tar.gz
Algorithm Hash digest
SHA256 6673cbc328c6c194ab873c3b1d3ab8bbdb05dc7552fb2b9fed27c32089393900
MD5 56a9e5fdfc3a6db504bbbd4f06bec53c
BLAKE2b-256 224f67b2d2280e1377527bd1c595d2bb95ea81b849cfde574eff4f86e2e5eb26

See more details on using hashes here.

File details

Details for the file snapdump-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: snapdump-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for snapdump-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 c8460f9f64f016b63bd1e2f30d2ced5753cd95b20f4b5f5b4be8e619345a05e4
MD5 044941da26827968b221bf7a8d785d6c
BLAKE2b-256 e9b8b59110dd59a1859d462578397bc854bf6c489358557af7182b58d058e761

See more details on using hashes here.

Supported by

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