btrbk
btrbk copied to clipboard
automated pre- and post- upgrade snapshots?
Thank you for creating and maintaining btrbk. Do you know if any pacman hooks exist for btrbk that could replace snap-pac (for those of us switching from snapper to btrbk)? If they don't exist, I volunteer to help someone create & test them.
snap-pac makes pacman automatically use snapper to create Snapper - ArchWiki like openSUSE's YaST. It uses Pacman#Hooks.
I assume somebody has already created such hooks for btrbk. If they don't exist, does anyone want to collaborate?
I'm not aware of pacman hooks, I suspect it should be as easy as running something like:
btrbk -c /usr/share/btrbk/contrib/pacman.conf <filter>
Events can be modeled using groups, e.g. specify "group pacman-post-install" and run btrbk pacman-post-install
Thank you for those suggestions.
@MountainX , did you get anywhere with this? I've just deployed Manjaro on btrfs and I'm looking to install btrbk (after a 5 year hiatus). I'd like to use btrbk exclusively, including for Pacman hooks. Curious if you've made progress on this, thanks!
@MountainX , did you get anywhere with this? I've just deployed Manjaro on btrfs and I'm looking to install btrbk (after a 5 year hiatus). I'd like to use btrbk exclusively, including for Pacman hooks. Curious if you've made progress on this, thanks!
@fmoledina: I've implemented a btrbk pre upgrade hook for myself and it works well with one caveat: btrbk has no concept of retaining "last N snapshots," only hourly, daily, weekly, etc. So if you have multiple upgrade snapshots per time interval (say daily) btrbk will prune all but the first when the next day rolls around.
Here's what I'm working with currently: https://gist.github.com/foundObjects/ec9a5aac9576b489edb6d67fcdb6827f
The aur-helper wrapper script is required to prevent aur helpers (paru or yay) from taking snapshots at each stage of a batched install process, without it they'll often take two or more snapshots per run.
@MountainX The above may interest you as well.
@foundObjects, that looks pretty good! I'll check it out sometime. Thanks!
@MountainX , did you get anywhere with this? I've just deployed Manjaro on btrfs and I'm looking to install btrbk (after a 5 year hiatus). I'd like to use btrbk exclusively, including for Pacman hooks. Curious if you've made progress on this, thanks!
@fmoledina: I've implemented a btrbk pre upgrade hook for myself and it works well with one caveat: btrbk has no concept of retaining "last N snapshots," only hourly, daily, weekly, etc. So if you have multiple upgrade snapshots per time interval (say daily) btrbk will prune all but the first when the next day rolls around.
Here's what I'm working with currently: https://gist.github.com/foundObjects/ec9a5aac9576b489edb6d67fcdb6827f
The aur-helper wrapper script is required to prevent aur helpers (paru or yay) from taking snapshots at each stage of a batched install process, without it they'll often take two or more snapshots per run.
@MountainX The above may interest you as well.
Yes, this interests me. It looks more sophisticated than what I implemented, although I packaged mine up into an Arch Linux (AUR) package with a PKGBUILD. I put it here a couple weeks ago:
My solution has been working for me, but I will review yours because you have added more functionality.