diff --git a/00-autosnap-btrfs.hook b/00-autosnap-btrfs.hook new file mode 100644 index 0000000..331e536 --- /dev/null +++ b/00-autosnap-btrfs.hook @@ -0,0 +1,14 @@ +[Trigger] +Type=Package +Operation=Install +Operation=Upgrade +Operation=Remove +Target=* + +[Action] +Description=Making BTRFS snapshot... +Depends=btrfs-progs +When=PreTransaction +Exec=/usr/bin/sh -c "/usr/bin/btrfs subvolume snapshot / /snaps/root@$(date +%Y-%m-%d_%H-%M-%S)_pacman_pre" +AbortOnFail +NeedsTargets