From d3f97ef2d5cabcb23f46129197577000ed82c4c7 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 31 Jan 2022 00:43:46 -0500 Subject: [PATCH] Added BTRFS snap hook --- 00-autosnap-btrfs.hook | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 00-autosnap-btrfs.hook 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