Skip to main content

ZFS incremental snapshot dump and restore tool

Project description

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.

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

$ ./snapdump.py     
usage: snapdump.py [-h] {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

backup

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

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.

list

Listing all current snapshots per dataset.

$ ./snapdump.py list
storage/datasets01:
        = storage/datasets01@2018_12_10__19_15_31
storage/home:
        = storage/home@2018_12_09__19_20_34
        + storage/home@2018_12_10__19_20_04

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

cleanup

Initiate the cleanup, this is not normally needed because back 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.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

snapdump-1.0.1-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: snapdump-1.0.1.tar.gz
  • Upload date:
  • Size: 6.0 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.1.tar.gz
Algorithm Hash digest
SHA256 51f7d6dc13f4bf9e442527f0aec89031f4c9dfd5b408157dba836cf873c8e516
MD5 99af365bab0ba55f2285aa027e9dd8a5
BLAKE2b-256 b4165df0dcb438434a3c9174f6d44eb13a9d56637116d2ad234548fabcf23775

See more details on using hashes here.

File details

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

File metadata

  • Download URL: snapdump-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bbc4f53647b79bd857c43f30d5b08d42e92dac79d94642b86bdd17f85f3a4e85
MD5 3dbe09be81ee61dcfec517937aaf58e8
BLAKE2b-256 c82ca33255b2671cac7e711342a6ef23c34d8c30fbbc615897e4e906bc96f0d4

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