From da44e13f03de3a13f122204e620c0583bc40365c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 31 Jul 2023 22:18:01 -0400 Subject: [PATCH] add btrbk to arch --- arch.md | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++-- pc_fedora.md | 2 +- 2 files changed, 65 insertions(+), 3 deletions(-) diff --git a/arch.md b/arch.md index f95b266..946b4ad 100644 --- a/arch.md +++ b/arch.md @@ -16,6 +16,7 @@ - [Steam](#steam) - [XWayland](#xwayland) - [Wireguard](#wireguard) + - [btrbk](#btrbk) - [Help](#help) - [Update Grub](#update-grub) - [Downgrading Kernel](#downgrading-kernel) @@ -134,8 +135,8 @@ Set up locale with correct information (required for certain binaries like minec 1. `sudo pacman -S fprintd` 2. `sudo systemctl enable --now fprintd` 3. Enable fingerprint terminal login but prompt for password first (enter switches to prompt for fingerprint) - - sudo vim sudo vim /etc/pam.d/sudo and at the top of the file: + + sudo vim /etc/pam.d/sudo and at the top of the file: ```conf # fingerprint auth @@ -250,6 +251,67 @@ Provides compatibility with X server applications (like wine) 1. `sudo pacman -S wireguard-tools` +### btrbk + +1. Grab the btrbk binary from the github repo. Copy it to /usr/local/bin/btrbk. +2. Create a snapshot config + +/etc/btrbk/snapshots.conf + +```conf +snapshot_preserve_min 24h +snapshot_preserve 14d + +volume /mnt/btr_pools/root + subvolume root + snapshot_dir .snapshots + +volume /mnt/btr_pools/root + subvolume home + snapshot_dir .snapshots + +volume /mnt/btr_pools/root + subvolume libvirt + snapshot_dir .snapshots + +volume /mnt/btr_pools/root + subvolume nextcloud + snapshot_dir .snapshots +``` + +3. Then create a snapshot service at /etc/systemd/system/btrbk_snapshots.service + +```conf +[Unit] +Description=Runs btrbk with config file at /etc/btrbk/snapshots.conf + +[Service] +ExecStart=/usr/local/bin/btrbk -c /etc/btrbk/snapshots.conf -v run +``` + +4. Then create a timer for the service at /etc/systemd/system/btrbk_snapshots.timer + +```conf +[Unit] +Description=Run snapshots every hour + +[Timer] +OnCalendar=hourly + +AccuracySec=10min +Persistent=true +Unit=btrbk_snapshots.service + +[Install] +WantedBy=timers.target +``` + +5. Then enable the service + +```bash +systemctl enable --now btrbk_snapshots.conf +``` + ## Help ### Update Grub diff --git a/pc_fedora.md b/pc_fedora.md index 1d24068..c11b0df 100644 --- a/pc_fedora.md +++ b/pc_fedora.md @@ -102,7 +102,7 @@ And timers to run the btrbk services on a regular schedule. Description=Run btrbk_snapshots every hour [Timer] -OnCalendar=hourlyalways want to give it a device name; the implicit selection may be right in some cases but it's better not to rely on it. +OnCalendar=hourly AccuracySec=10min Persistent=true