Compare commits

...

2 Commits

View File

@@ -101,7 +101,7 @@ zpool/root/archlinux@pacman_2023-03-07-0114_op:inst_sev:trv
zpool/root/archlinux@pacman_2023-03-07-0115_op:upgr_sev:trv zpool/root/archlinux@pacman_2023-03-07-0115_op:upgr_sev:trv
``` ```
Whatever you set as your `pkgs_list_max_length` is still just a best effort as it is subject to ZFS' internal maximum for dataset name length. This limit is currently 255 characters. For a snapshot this is counted against the dataset name in front of the `@` character plus everything else starting with the `@` character til the end. If you'd like e.g. 200 characters allocated to the package list chances are that you'll see fewer characters than that depending on how long your dataset names are on their own. Whatever you set as your `pkgs_list_max_length` is still just a best effort as it is subject to ZFS' internal maximum for dataset name length. This limit is currently 255 characters. For a snapshot the dataset name in front of the `@` character plus everything else starting with the `@` character til the end count against the limit. If you'd like e.g. 200 characters allocated to the package list chances are that you'll see fewer characters than that depending on how long your dataset names are on their own.
Have a look at `pacman-zfs-snapshot.conf` as well, its comments should be clear enough to get you going. Have a look at `pacman-zfs-snapshot.conf` as well, its comments should be clear enough to get you going.
@@ -157,7 +157,25 @@ This behavior is not configurable. During testing and development we considered
...2023-03-07-0116-2... ...2023-03-07-0116-2...
...2023-03-07-0116-3... ...2023-03-07-0116-3...
``` ```
While this would effectively avoid naming collisions we decided against it. Weighing pros and cons the _skip_ approach seems ever so sleightly simpler than the _counter_ approach. While this would effectively avoid naming collisions we decided against it. Weighing pros and cons the _skip_ approach seems ever so slightly simpler than the _counter_ approach.
## A word of warning
Note that skipping snapshot creation to avoid naming collisions can become overly dangerous if you strip away too many unique features from snapshot names. This may happen mostly in two ways:
1. Remove the package name list by setting `pkgs_list_max_length='0'`.
1. Remove distinguishing characters from timestamps via `snap_date_format='%F-%H%M'`
Without a package list two consecutive snapshots may look like so:
```
zpool/root/archlinux@pacman_2023-03-07-0116_op:inst_sev:trv
zpool/root/archlinux@pacman_2023-03-07-0116_op:upgr_sev:trv
```
If you then install any unrelated package within the same minute the `pacman` operation will be treated as identical to line 1 and this script will skip snapshot creation. Similarly if you lower timestamp fidelity to e.g. `%Y%m%d` (`20230307` instead of `2023-03-07-0116`) above example snapshots will look like so:
```
zpool/root/archlinux@pacman_20230307_op:inst_sev:trv
zpool/root/archlinux@pacman_20230307_op:upgr_sev:trv
```
All future _Install_ or _Upgrade_ operations within the same day will then also not be covered by snapshots. While this script will print warnings when it skips snapshot creation we suggest you change `pkgs_list_max_length` and `snap_date_format` options carefully. Defaults have proven to work well on example daily driver systems.
# Rollback # Rollback