From 8bc96ba0e8624b143658578f95eb4fd9edaa84ec Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sun, 31 Mar 2024 23:06:53 +0800 Subject: [PATCH] docs: usage of btrbk --- modules/nixos/base/btrbk.nix | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/nixos/base/btrbk.nix b/modules/nixos/base/btrbk.nix index e97c9824..be165ae0 100644 --- a/modules/nixos/base/btrbk.nix +++ b/modules/nixos/base/btrbk.nix @@ -1,6 +1,21 @@ { + # ================================================================== + # # Tool for creating snapshots and remote backups of btrfs subvolumes - # https://github.com/digint/btrbk + # https://github.com/digint/btrbk + # + # Usage: + # 1. btrbk will create snapshots on schedule + # 2. we can use `btrbk run` command to create a backup manually + # + # How to restore a snapshot: + # 1. Find the snapshot you want to restore in /snapshots + # 2. Use `btrfs subvol delete /btr_pool/@persistent` to delete the current subvolume + # 3. Use `btrfs subvol snapshot /snapshots/2021-01-01 /btr_pool/@persistent` to restore the snapshot + # 4. reboot the system or remount the filesystem to see the changes + # + # ================================================================== + services.btrbk.instances.btrbk = { # How often this btrbk instance is started. See systemd.time(7) for more information about the format. onCalendar = "daily";