From 9f6b6114104de9e4cc642e5fddad2ded81654e5e Mon Sep 17 00:00:00 2001 From: ducoterra Date: Mon, 10 Apr 2023 09:47:38 -0400 Subject: [PATCH] add btrbk configs --- pc_fedora.md | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/pc_fedora.md b/pc_fedora.md index d0ea1b5..38d8c31 100644 --- a/pc_fedora.md +++ b/pc_fedora.md @@ -18,6 +18,115 @@ protect. 9. On the faster 1TB drive create an unencrypted btrfs partition and mount it at "/steam" 10. Click "Done" and begin installation +## btrbk + +```bash +sudo dnf install btrbk +``` + +As usual, you'll need a snapshot service and backup service. These get more complicated +with multi-drive mounts (but actually easier at the same time since each volume is self- +contained). + +/etc/btrbk/btrbk_snapshots.conf + +```conf +snapshot_preserve_min 24h +snapshot_preserve 24h 14d + +volume /mnt/btr_pools + subvolume root + snapshot_dir root/.snapshots + +volume /mnt/btr_pools + subvolume home + snapshot_dir home/.snapshots + +volume /mnt/btr_pools + subvolume steam + snapshot_dir steam/.snapshots +``` + +/etc/btrbk/btrbk_backup.conf + +```conf +snapshot_preserve_min all +snapshot_create no +target_preserve_min no +target_preserve 24h 7d 4w *m + +volume /mnt/btr_pools + subvolume root + snapshot_dir root/.snapshots + target /mnt/backup/root + +volume /mnt/btr_pools + subvolume home + snapshot_dir home/.snapshots + target /mnt/backup/home + +volume /mnt/btr_pools + subvolume steam + snapshot_dir steam/.snapshots + target /mnt/backup/steam +``` + +Then you'll need a service to run btrbk_snapshots and btrbk_backup. + +/etc/systemd/system/btrbk_snapshots.service + +```conf +[Unit] +Description=Runs btrbk with config file at /etc/btrbk/btrbk_snapshots.conf + +[Service] +ExecStart=/usr/bin/btrbk -c /etc/btrbk/btrbk_snapshots.conf -v run +``` + +/etc/systemd/system/btrbk_backup.service + +```conf +[Unit] +Description=Runs btrbk with config file at /etc/btrbk/btrbk_backup.conf + +[Service] +ExecStart=/usr/bin/btrbk -c /etc/btrbk/btrbk_backup.conf -v run +``` + +And timers to run the btrbk services on a regular schedule. + +/etc/systemd/system/btrbk_snapshots.timer + +```conf +[Unit] +Description=Run btrbk_snapshots every hour + +[Timer] +OnCalendar=hourly +AccuracySec=10min +Persistent=true +Unit=btrbk_snapshots.service + +[Install] +WantedBy=timers.target +``` + +/etc/systemd/system/btrbk_backup.timer + +```conf +[Unit] +Description=Run btrbk_backup every hour + +[Timer] +OnCalendar=hourly +AccuracySec=10min +Persistent=true +Unit=btrbk_backup.service + +[Install] +WantedBy=timers.target +``` + ## RDP with autologin https://askubuntu.com/questions/1396745/21-10-make-screen-share-password-permanent