ZFS Uploader
ZFS Uploader is a simple program for backing up full and incremental ZFS
snapshots to Amazon S3. It supports CRON based scheduling and can
automatically remove old snapshots and backups. A helpful CLI (zfsup) lets
you run jobs, restore, and list backups.
Features
- Backup/restore ZFS file systems
- Create incremental and full backups
- Automatically remove old snapshots and backups
- Use any S3 storage class type
- Helpful CLI
Requirements
- Python 3.6 or higher
- ZFS 0.8.1 or higher (untested on earlier versions)
Install Instructions
Commands should be run as root.
- Create a directory and virtual environment
mkdir /etc/zfs_uploader
cd /etc/zfs_uploader
virtualenv --python python3 env
- Install ZFS Uploader
source env/bin/activate
pip install zfs_uploader
ln -sf /etc/zfs_uploader/env/bin/zfsup /usr/local/sbin/zfsup
- Write configuration file
Please see the Configuration File section below for helpful configuration examples.
vi config.cfg
chmod 600 config.cfg
- Start service
cp zfs_uploader.service /etc/systemd/system/zfs_uploader.service
sudo systemctl enable --now zfs_uploader
- List backups
zfsup list
Configuration File
The program reads backup job parameters from a configuration file. Default parameters may be set which then apply to all backup jobs. Multiple backup jobs can be set in one file.
Parameters
bucket_name : str
S3 bucket name.
access_key : str
S3 access key.
secret_key : str
S3 secret key.
filesystem : str
ZFS filesystem.
prefix : str, optional
Prefix to be prepended to the s3 key.
region : str, default: us-east-1
S3 region.
endpoint : str, optional
S3 endpoint for alternative services
cron : str, optional
Cron schedule. Example: * 0 * * *
max_snapshots : int, optional
Maximum number of snapshots.
max_backups : int, optional
Maximum number of full and incremental backups.
max_incremental_backups_per_full : int, optional
Maximum number of incremental backups per full backup.
storage_class : str, default: STANDARD
S3 storage class.
max_multipart_parts : int, default: 10000
Maximum number of parts to use in a multipart S3 upload.
Examples
Multiple full backups
[DEFAULT]
bucket_name = BUCKET_NAME
region = us-east-1
access_key = ACCESS_KEY
secret_key = SECRET_KEY
storage_class = STANDARD
[pool/filesystem]
cron = 0 2 * * *
max_snapshots = 7
max_incremental_backups_per_full = 6
max_backups = 7
Filesystem is backed up at 02:00 daily. Only the most recent 7 snapshots are kept. The oldest backup without dependents is removed once there are more than 7 backups.
Backblaze B2 S3-compatible endpoint, full backups
[DEFAULT]
bucket_name = BUCKET_NAME
region = eu-central-003
access_key = ACCESS_KEY
secret_key = SECRET_KEY
storage_class = STANDARD
endpoint = https://s3.eu-central-003.backblazeb2.com
[pool/filesystem]
cron = 0 2 * * *
max_snapshots = 7
max_incremental_backups_per_full = 6
max_backups = 7
Structure
full backup (f), incremental backup (i)
- f
- f i
- f i i
- f i i i
- f i i i i
- f i i i i i
- f i i i i i i
- f i i i i i f
- f i i i i f i
- f i i i f i i
- f i i f i i i
- f i f i i i i
- f f i i i i i
- f i i i i i i
Single full backup
[DEFAULT]
bucket_name = BUCKET_NAME
region = us-east-1
access_key = ACCESS_KEY
secret_key = SECRET_KEY
storage_class = STANDARD
[pool/filesystem]
cron = 0 2 * * *
max_snapshots = 7
max_backups = 7
Filesystem is backed up at 02:00 daily. Only the most recent 7 snapshots are kept. The oldest incremental backup is removed once there are more than 7 backups. The full backup is never removed.
Structure
full backup (f), incremental backup (i)
- f
- f i
- f i i
- f i i i
- f i i i i
- f i i i i i
- f i i i i i i
Only full backups
[DEFAULT]
bucket_name = BUCKET_NAME
region = us-east-1
access_key = ACCESS_KEY
secret_key = SECRET_KEY
storage_class = STANDARD
[pool/filesystem]
cron = 0 2 * * *
max_snapshots = 7
max_incremental_backups_per_full = 0
max_backups = 7
Filesystem is backed up at 02:00 daily. Only the most recent 7 snapshots are kept. The oldest full backup is removed once there are more than 7 backups. No incremental backups are taken.
Structure
full backup (f)
- f
- f f
- f f f
- f f f f
- f f f f f
- f f f f f f
- f f f f f f f
Miscellaneous
Storage class codes
- STANDARD
- REDUCED_REDUNDANCY
- STANDARD_IA
- ONEZONE_IA
- INTELLIGENT_TIERING
- GLACIER
- DEEP_ARCHIVE
- OUTPOSTS
Release Instructions
-
Increment version in
__init__.pyfile -
Update
CHANGELOG.mdwith new version -
Tag release in GitHub when ready. Add changelog items to release description. GitHub Action workflow will automatically build and push the release to PyPi.
Metadata
Release files for zfs-uploader 0.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| zfs_uploader-0.9.0.tar.gz | 18.4 kB | Without provenance | Details for zfs_uploader-0.9.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zfs_uploader-0.9.0-py3-none-any.whl | Python 3 | none | any | Details for zfs_uploader-0.9.0-py3-none-any.whl |
Total release size: 34.5 kB
Release files / zfs_uploader-0.9.0.tar.gz
| Download URL | zfs_uploader-0.9.0.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d54d28b6a462591070b1a9361821558392885807007c5920e949d434c9b0046b
|
|
BLAKE2b-256 checksum How to use checksums |
55b4b371973c5b0dcf6333f18331f24c618c2450ac37bd90d128a6039f7ee0c6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / zfs_uploader-0.9.0-py3-none-any.whl
| Download URL | zfs_uploader-0.9.0-py3-none-any.whl |
|---|---|
| Size | 16.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d73560764f9c12225ed2deef65fa9bcaf9353e10a45e4c298b283daa8228fca6
|
|
BLAKE2b-256 checksum How to use checksums |
35d89a859438c4f27b78fc2b208ecbfc8b3e5fd360e519f5dfeedfc602f5ced0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for zfs-uploader 0.9.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.