Skip to main content

A system level API to query and manage the SAFER-STORAGE backup and storage in space in time dimensions

Project description

SAFER STORAGE NAS Historical management

This project implements a system level API to query and manage the SAFER-STORAGE backup and storage in space and time dimensions (hence the historical dimension). Each command of this API is designed to be either invoked directly from the shell or wrapped into an higher level API, eg. a web-ui back-end.

The SAFER-STORAGE backup system is extensively based on ZoL snapshots as found in particulat in the Proxmox VE distribution. Notice that some features may be unavailable depending on which ZoL version is available on the execution platform.

Install

This project uses python v3.7.4. We recommend installing python using pyenv eg. with the pyenv installer, as a regular (non-root) user:

$ curl https://pyenv.run | bash
$ pyenv install 3.7.4
$ pyenv local 3.7.4

Note that if python is already installed or you are already pyenv but an older version, version 3.7.4 may not be available. Simply erase your previous pyenv installation an reinstall from scratch (or use vagrant, for a clean fresh start).

This package is then available through PyPI using the following command:

$ pip install --upgrade safer_hist_pkg

Usage

safer : main command

The commands of this package are part of a module named safer_hist. For convenience, we also recommend defining the following funtion in your shell (eg. in your .bashrc):

function safer() 
{
    case $1 in
        help|lssnaps|genmeta|lsuntil|lsalltime|restore)
            subcmd=$1
            shift
            python -m safer_hist ${subcmd} "$@"
            ;;
        *)
            python -m safer_hist help "$@"
            ;;
    esac
}

safer genmeta: Snapshot meta-info generation

Generates a snapshot meta file for the snapshot @<snapshot> of the (ZFS) dataset <dataset>. By default the output is written to a file named .zfsmeta_<snapshot> at the root of the dataset. If -o option is given, output is written to the specied filename or to stdout if - (minus) is given instead of a filename.

$ safer genmeta [-o file|-] dataset@snapshot

safer lssnaps: Snapshot list

safer lsuntil: Merge target dir content from snapshots until

safer lsalltime: Marge target dir content from all snapshots

safer restore: Restore file from snapshot

Packaging and deploying to PyPI

(reminder, see this tuto)

Install building dependencies as follows:

$ python3 -m pip install --upgrade setuptools wheel

Build package as follows:

$ python3 setup.py sdist bdist_wheel

Upload to PyPI server:

$ python3 -m twine upload dist/*

License

Licensed under the EUPL

Author(s)

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

safer-hist-0.0.2.tar.gz (3.4 kB view hashes)

Uploaded Source

Built Distribution

safer_hist-0.0.2-py3-none-any.whl (10.3 kB view hashes)

Uploaded Python 3

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