https://github.com/paxswill/zfs-apt-snapshot
Small script for creating ZFS snapshots when upgrading packages through APT
https://github.com/paxswill/zfs-apt-snapshot
Last synced: about 2 months ago
JSON representation
Small script for creating ZFS snapshots when upgrading packages through APT
- Host: GitHub
- URL: https://github.com/paxswill/zfs-apt-snapshot
- Owner: paxswill
- Created: 2019-07-05T11:37:07.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-10-18T16:25:19.000Z (over 5 years ago)
- Last Synced: 2025-03-27T04:33:27.905Z (2 months ago)
- Language: Python
- Size: 54.7 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.mdown
Awesome Lists containing this project
README
Python script for automatically creating ZFS snapshots when
installing/removing/upgrading packages through APT. The snapshots are only
created on the filesystems that are going to be affected by the changes,
minimizing the number of snapshots (and possible wasted space).# Install
There's no install script (or package) yet, so it's all manual for now. There's
two hard external dependencies, Python 3 and the Python APT bindings. If
available, the Python ZFS bindings are also used. The ZFS bindings are only
available (or at least packaged) for ZFS on Linux >=0.8.0, so if you're using
your distro's packages, the bindings are only available for Debian >=buster and
\*buntu >=eoan. To install (skip the ZFS bindings if they're not available):sudo apt install python-apt python3-pyzfs
After that, copy the script to `/usr/local/bin` and add the APT config file:
sudo mkdir -p /usr/local/bin
sudo cp ./zfs_apt_snapshot.py /usr/local/bin/zfs-apt-snapshot
sudo chmod +x /usr/local/bin/zfs-apt-snapshot
sudo cp ./90apt-zfs-snapshot /etc/apt/apt.conf.d/You can check out the available options with `zfs-apt-snapshot --help`. I'd
recommend editing `/etc/apt/apt.conf.d/90apt-zfs-snapshot` to purge old
snapshots as well (not on by default for safety).