/ vimwiki / 250316-0012.wiki
250316-0012.wiki
 1  %title My Borg + Nix Setup
 2  :tools:cli:nix:
 3  %date 2025-03-16 00:12
 4  %update 2025-03-16 22:35
 5  
 6  The [[201105-2104|old instructions]] I had weren't cutting it.
 7  
 8  I have a nixos module for configuring borg to my server, that allows each server to define it's own repo
 9  box -> mossnet
10  
11  You can find other repos for each server by digging around their `mossnet.backup` config definition in [helm](https://git.merveilles.town/aynish/helm)
12  The password for saving backups is stored under `borg-` in pass, and the ssh key should have access to rsync, so you don't need the rsync password
13  
14  = List archives =
15  Each repo has an archive for each day, so you can restore a _specific_ nightly backup
16  `borg list 20779@hk-s020.rsync.net:mossnet --rsh 'ssh -i /root/borg/borg-key'`
17  
18  = Extract files =
19  Files will be restored to the directory based on your relative working directory.
20  Most backups are saved from `/` the very root directory. Only `sudo` has access to the root key. 
21  `borg extract 20779@hk-s020.rsync.net:mossnet::box-mossnet-2025-02-11T00:00:03 --rsh 'ssh -i /root/borg/borg-key' <path/to/restore>`
22  
23  The `--dry-run` and `--list` command can help look around for the specific file you want to load, if it is a specific file.