snapk is a bash script providing snapper pre-post snapshots for Alpine Package Keeper as a commit hook. It was originally inspired by snap-xbps for Void Linux.
Simply run # make install
to install snapk and # make uninstall
to do the opposite. Default installation prefix is /usr/local
.
Default snapk configuration is located at /etc/snapk.conf
. The only parameters are:
- ABORT_ON_FAIL - Abort apk transaction if snapk fails (default: "yes")
- DESC_LIMIT - Number of characters to be shown in snapshot descrition (default: 72)
- INCLUDE - List of snapper configs to include OR "all" (default: "root")
- IGNORE - List of snapper configs to ignore OR empty (default: "")
Most of those parameters can be overriden with environment variables:
- SNAPK_SKIP - Skip snapk if variable is set
- SNAPK_CONFIG - Path to snapk configuration file (default: "/etc/snapk.conf")
- SNAPK_ABORT - Same as
$ABORT_ON_FAIL
- SNAPK_INCLUDE - Same as
$INCLUDE
- SNAPK_IGNORE - Same as
$IGNORE
In order to specify one of them apk
must be launched with --preserve-env
flag. If launching apk
requires elevated privilleges (the usual case), some additional steps might be taken. For instance, when using doas
utility one must provide setenv { ... }
option in doas.conf
containing all the variables that will be transfered into fresh environment. Example configuration can be found in doas.conf.example
.