Skip to content

ZxyBackupCloser is an easy backup application to store your ZFS pools containing a lot of snapshots to another ZFS pool or dataset. You back up your ZFS pools with one command, only ZxyBackupCloser.

License

Notifications You must be signed in to change notification settings

mikanmi/zxybackupcloser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZxyBackupCloser

ZxyBackupCloser is an easy backup application to store your ZFS pools containing a lot of snapshots to another ZFS pool or dataset.

Patineboot is backing up all Patineboot's ZFS pools on internal SSDs to an external SSD with ZxyBackupCloser every time.

Feature

You back up your ZFS pools with the one command, only ZxyBackupCloser.

  • ZxyBackupCloser keeps all of the snapshots of your ZFS pools in the backup ZFS pools.
  • ZxyBackupCloser supports the incremental backup from the previous backup.
  • ZxyBackupCloser verifies the original and the backup ZFS pools with the portable mac.
  • ZxyBackupCloser gets the difference between the previous and the present backup ZFS pools.

Official Web Site

Official Release: https://pypi.org/project/zxybackupcloser/

Official Development Site: https://github.com/patineboot/zxybackupcloser

Install ZxyBackupCloser (Recommend)

  1. Install ZxyBackupCloser from PyPI.

    Install zxybackupcloser with the pip3 command.

    pip3 install zxybackupcloser

Dependency

  1. 'Pipe Viewer' and 'zfs-auto-snapshot'

    Install 'Pipe Viewer' and 'zfs-auto-snapshot' with apt.

    apt install pv zfs-auto-snapshot

Get more information:

Usage

Basic Usage

Back up your ZFS pools with zxybackupcloser:

zxybackupcloser -b <backup pool> <original pools>
  • <original pools>: specify the one or more names of the original ZFS pools.
  • <backup pool>: specify the name of the destination pool or dataset to store the original pools.

e.g., Patineboot backs up two of the original pools named home.pool and storage.pool to the backup.pool pool.

sudo zxybackupcloser -b backup.pool home.pool storage.pool

Warn: Remove the com.sun:auto-snapshot property on the backup pool, or taking snapshots disturb the backup process.

Remove the com.sun:auto-snapshot property:

sudo zfs set com.sun:auto-snapshot=false <backup pool>

Advanced Usage

See more detail of usage, run the zxybackupcloser command with the -h option.

$ zxybackupcloser -h

usage: zxybackupcloser [-h] -b BACKUP [-d] [-v] [-n] [-u] pool [pool ...]

_ZxyBackupCloser_ is a backup application to back up some ZFS pools to another ZFS pool or dataset.

positional arguments:
  pool                  specify one or more names of the original ZFS pools.

optional arguments:
  -h, --help            show this help message and exit
  -b BACKUP, --backup BACKUP
                        specify the name of the pool or dataset to store the original pools.
  -d, --diff            get the difference of the backups from previous to present.
  -v, --verbose         run with verbose mode.
  -n, --dry-run         run with no changes made.
  -u, --user            run on your normal user account.

Helpful Tool

Patineboot has two helpful tools in the misc directory.

  • zfs-load-enckey.service
    Load the encryption key and mount filesystems automatically on the booting of your machine.
  • zxycloser_warapper.sh
    Fulfill Patineboot's pools and verify the backup automatically.

Install and run ZxyBackupCloser from GitHub

  1. Get ZxyBackupCloser from GitHub.com

    Get ZxyBackupCloser with git clone:

    git clone https://github.com/patineboot/zxybackupcloser.git
  2. Run the backupcloser.py script

    Move the current directory to the script directory by cd zxybackupcloser/src/zxybackupcloser and run the backupcloser.py script:

    cd ./zxybackupcloser/src/zxybackupcloser
    sudo ./backupcloser.py -h

Configure ZxyBackupCloser

Patineboot prepared the macros for deep configuration on the backupcloser.py script file. Change the macros for taking the snapshots and logging while backing up.

Notice: you can find the place of the backupcloser.py file with pip3 show zxybackupcloser.

Environment

Patineboot is running ZxyBackupCloser with the following software environment. ZxyBackupCloser can run with other software or versions.

OS: Ubuntu Server 22.04

  • Python 3.10.4
  • ZFS on Linux 2.1.2
  • pv 1.6.6
  • zfs-auto-snapshot 1.2.4

Deploy ZxyBackupCloser for Patineboot's development

Run ZxyBackupCloser while developing:

sudo PYTHONPATH=../ ./backupcloser.py -b <backup pool> <original pools>

Deploy ZxyBackupCloser on PyPI:

python3 -m build
python3 -m twine upload dist/*

twine asks:

User: patineboot
Pass: <your passphrase>

Update ZxyBackupCloser from PyPI.

Update zxybackupcloser with the pip3 command.

pip3 install -U zxybackupcloser

Reference: Packaging Python Projects

About

ZxyBackupCloser is an easy backup application to store your ZFS pools containing a lot of snapshots to another ZFS pool or dataset. You back up your ZFS pools with one command, only ZxyBackupCloser.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published