You are not logged in.

#1 2016-03-11 18:26:34

wba072
Member
Registered: 2010-11-11
Posts: 33

snap-pac - automatic snapper btrfs snapshots via pacman hooks

This package makes pacman use snapper to automatically take a pre and post snapshot before and after pacman transactions, similar to how YaST does with OpenSuse. All you need to do is install it and continue to use pacman as normal. Snapper will create pre/post snapshots automatically when pacman upgrades/installs/removes something. No running a separate script or creating bash aliases needed.

It's basically two hooks for pacman (one for pretransaction and one for post) and two small bash scripts to call snapper (again, one for pre and one for post).

Here's the AUR package:
https://aur.archlinux.org/packages/snap-pac

Here's the home page:
https://github.com/wesbarnett/snap-pac

Last edited by wba072 (2016-03-11 20:17:25)

Offline

#2 2016-04-23 01:57:16

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

After some feedback, the latest version (0.3) now logs the pacman command that triggers the hook as the snapper snapshot description. I've also updated the README with a more thorough description of how to undo changes from a pacman transaction.

Offline

#3 2016-04-23 23:32:01

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

A couple of more changes today. I went ahead and issued a new release 0.4. The main thing is that I've moved the scripts to /usr/share/libalpm/hooks.bin/snap-pac so that they are not in the user's path. I also renamed the scripts to be consistent with the hooks. Lastly, the message about the grub-config hook only shows up if grub itself is not used. Have some other things in the works, but I don't want to do another release so quickly without some more changes.

Offline

#4 2016-04-26 20:18:02

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

New release today. Lots of improvements. You can now easily configure which snapper configurations you want to use as well as change the description, all in the snapper configuration file itself. Additionally the scripts are now unified into one bash script, although that shouldn't effect the user.

Release notes for 0.5:
* Unified scripts into one main script.
* Moved temporary file with pre number to `/tmp`.
* Script now resides at `/usr/share/libalpm/hooks.bin` (no subdir named snap-pac)
* Created install script - mainly for use with a PKGBUILD.
* Created configuration options that can be set in snapper configuration files.
* Can take snapshots of multiple snapper configurations.
* Can change the description and cleanup algorithm.
* All around better practices in the shell script.
* Removed grub configuration hook - doesn't really fit this project.
* Updated documentation.
* License in each file.

Not really planning on any more changes, unless there are some good suggestions or bugs.

Last edited by wba072 (2016-04-26 20:18:35)

Offline

#5 2016-04-27 15:57:53

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

Minor release 0.5.1 today. Realized the snapshots need to occur before/after all other hooks are done processing. Since Arch is pushing out many hooks in the coming days, I renamed the two hooks so that the pre snapshot is always done first and the post snapshot is always the last thing processed.

Offline

#6 2016-05-21 02:59:13

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

Release 0.6 today.

* Add warnings when no snapshots are taken (if not properly configured)
* Use Makefile
* Update descriptions of hooks
* Better way to get snapper configs info

Offline

#7 2016-06-11 11:58:34

wba072
Member
Registered: 2010-11-11
Posts: 33

Re: snap-pac - automatic snapper btrfs snapshots via pacman hooks

Release 0.6.1 yesterday

* Simplifies the Makefile
* Uses shellcheck (better practices in some syntax)
* Updated README
* Signed with PGP key

Offline

Board footer

Powered by FluxBB