diff --git a/README.md b/README.md index e7b9e74..1ef6cd3 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Arch Linux pacman hook for automatic ZFS snapshots Get started like so: -1. Install dependency `zfs-auto-snapshot` +1. Install dependency `jq` 1. Clone repo into arbitrary path `` 1. Make `pacman-zfs-snapshot.sh` executable ``` @@ -29,7 +29,7 @@ In `pacman` on every `PreTransaction`, meaning right before any actual operation We retain two different snapshot chains, one for `pacman` transactions that only affect what we are calling _trivial_ packages and a separate chain for _important_ packages. By default only the exact regular expression package name match `^linux$` is considered important. Whenever an important package is affected by a transaction a snapshot goes into the corresponding chain. In all other cases - when an important package is not affected - snapshots go into the trivial chain. -We use `zfs-auto-snapshot` both for snapshot creation and for destroying old snapshots. The _trivial_ snapshot chain by default keeps 15 snapshots, the _important_ chain keeps 5. The thought process here is that you will likely not futz around with a kernel every day whereas you may very well install arbitrary packages multiple times a day. Snapshots should keep you safe for a couple of days hence the defaults of 5 and 15 snapshots, respectively. +The _trivial_ snapshot chain by default keeps 15 snapshots, the _important_ chain keeps 5. The thought process here is that you will likely not futz around with a kernel every day whereas you may very well install arbitrary packages multiple times a day. Snapshots should keep you safe for a couple of days hence the defaults of 5 and 15 snapshots, respectively. You may optionally include more ZFS datasets in this snapshot mechanism. Have a look at `pacman-zfs-snapshot.conf`, its comments should be clear enough to get you going. @@ -52,7 +52,6 @@ Commit _types_ besides `fix` and `feat` are: The following _scopes_ are known for this project. A Conventional Commits commit message may optionally use one of the following scopes or none: -- `auto`: Change how `zfs-auto-snapshot` is run - `conf`: How we deal with script config - `script`: Any other script work that doesn't specifically fall into the above scopes - `hook`: Configuring the hook(s) diff --git a/pacman-zfs-snapshot-install.hook b/pacman-zfs-snapshot-install.hook index 9481649..fec6d6f 100644 --- a/pacman-zfs-snapshot-install.hook +++ b/pacman-zfs-snapshot-install.hook @@ -7,6 +7,6 @@ Target = * Description = Create ZFS snapshot on active system dataset When = PreTransaction Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot install' -Depends = zfs-auto-snapshot +Depends = jq AbortOnFail NeedsTargets diff --git a/pacman-zfs-snapshot-remove.hook b/pacman-zfs-snapshot-remove.hook index 204b04a..0ce9e32 100644 --- a/pacman-zfs-snapshot-remove.hook +++ b/pacman-zfs-snapshot-remove.hook @@ -7,6 +7,6 @@ Target = * Description = Create ZFS snapshot on active system dataset When = PreTransaction Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot remove' -Depends = zfs-auto-snapshot +Depends = jq AbortOnFail NeedsTargets diff --git a/pacman-zfs-snapshot-upgrade.hook b/pacman-zfs-snapshot-upgrade.hook index b41f3ab..997a7a7 100644 --- a/pacman-zfs-snapshot-upgrade.hook +++ b/pacman-zfs-snapshot-upgrade.hook @@ -7,6 +7,6 @@ Target = * Description = Create ZFS snapshot on active system dataset When = PreTransaction Exec = /bin/sh -c 'while read -r f; do echo "$f"; done | /usr/local/bin/pacman-zfs-snapshot upgrade' -Depends = zfs-auto-snapshot +Depends = jq AbortOnFail NeedsTargets