From 8c03621262cb79281f5d69a9142297bbc6359a7e Mon Sep 17 00:00:00 2001 From: BrainwreckedTech Date: Wed, 25 Jan 2023 00:51:18 -0500 Subject: [PATCH] Add ZFS autosnap for gitea web app package --- 01-autosnap-zfs-gitea.hook | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 01-autosnap-zfs-gitea.hook diff --git a/01-autosnap-zfs-gitea.hook b/01-autosnap-zfs-gitea.hook new file mode 100644 index 0000000..24c1d51 --- /dev/null +++ b/01-autosnap-zfs-gitea.hook @@ -0,0 +1,13 @@ +[Trigger] +Type=Package +Operation=Install +Operation=Upgrade +Operation=Remove +Target=gitea + +[Action] +Description=Making ZFS snapshot for gitea... +Depends=zfs-utils +When=PreTransaction +Exec=/usr/bin/sh -c "/usr/bin/zfs snapshot -r $(/usr/bin/findmnt -n /var/lib/gitea | /usr/bin/awk '{print $2}')@$(/bin/date +%Y-%m-%d)_v$(/usr/bin/pacman -Q gitea | /bin/sed 's/gitea //g')" +NeedsTargets