mirror of
https://github.com/starr-dusT/dotfiles.git
synced 2025-02-19 19:27:31 -08:00
updates for btrbk
This commit is contained in:
parent
a40487c018
commit
2e5021e0da
@ -1,40 +0,0 @@
|
|||||||
|
|
||||||
#
|
|
||||||
# Example btrbk configuration file
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# Please refer to the btrbk.conf(5) man-page for a complete
|
|
||||||
# description of all configuration options.
|
|
||||||
# For more examples, see README.md included with this package.
|
|
||||||
#
|
|
||||||
# btrbk.conf(5): <https://digint.ch/btrbk/doc/btrbk.conf.5.html>
|
|
||||||
# README.md: <https://digint.ch/btrbk/doc/readme.html>
|
|
||||||
#
|
|
||||||
# Note that the options can be overridden per volume/subvolume/target
|
|
||||||
# in the corresponding sections.
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
# Enable transaction log
|
|
||||||
transaction_log /var/log/btrbk.log
|
|
||||||
|
|
||||||
# Use sudo if btrbk or lsbtr is run by regular user
|
|
||||||
backend_local_user btrfs-progs-sudo
|
|
||||||
|
|
||||||
# Enable stream buffer. Adding a buffer between the sending and
|
|
||||||
# receiving side is generally a good idea.
|
|
||||||
# NOTE: If enabled, make sure to install the "mbuffer" package!
|
|
||||||
stream_buffer 256m
|
|
||||||
|
|
||||||
# Example retention policy:
|
|
||||||
snapshot_preserve_min 2d
|
|
||||||
snapshot_preserve 14d
|
|
||||||
|
|
||||||
target_preserve_min no
|
|
||||||
target_preserve 20d 10w *m
|
|
||||||
|
|
||||||
|
|
||||||
# Simple setup
|
|
||||||
volume /home
|
|
||||||
snapshot_dir .snapshots
|
|
||||||
subvolume home
|
|
29
.config/btrbk/home_btrbk.conf
Normal file
29
.config/btrbk/home_btrbk.conf
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#
|
||||||
|
# btrbk configuration file for /home
|
||||||
|
#
|
||||||
|
|
||||||
|
# Enable transaction log
|
||||||
|
transaction_log /var/log/home_btrbk.log
|
||||||
|
|
||||||
|
# Use sudo if btrbk or lsbtr is run by regular user
|
||||||
|
backend_local_user btrfs-progs-sudo
|
||||||
|
|
||||||
|
# Enable stream buffer
|
||||||
|
stream_buffer 256m
|
||||||
|
|
||||||
|
# Retention policy
|
||||||
|
snapshot_preserve_min 2d
|
||||||
|
snapshot_preserve 14d
|
||||||
|
|
||||||
|
target_preserve_min no
|
||||||
|
target_preserve 20d 10w *m
|
||||||
|
|
||||||
|
snapshot_dir .snapshots
|
||||||
|
|
||||||
|
# Local snapshots
|
||||||
|
volume /home
|
||||||
|
subvolume tstarr
|
||||||
|
# Always create snapshot, even if targets are unreachable
|
||||||
|
snapshot_create always
|
||||||
|
# Need a btrfs server before this will work
|
||||||
|
#target /mnt/engi/backup/kestrel_backups
|
26
.config/btrbk/root_btrbk.conf
Normal file
26
.config/btrbk/root_btrbk.conf
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#
|
||||||
|
# btrbk configuration file for root
|
||||||
|
#
|
||||||
|
|
||||||
|
# Enable transaction log
|
||||||
|
transaction_log /var/log/root_btrbk.log
|
||||||
|
|
||||||
|
# Use sudo if btrbk or lsbtr is run by regular user
|
||||||
|
backend_local_user btrfs-progs-sudo
|
||||||
|
|
||||||
|
# Enable stream buffer
|
||||||
|
stream_buffer 256m
|
||||||
|
|
||||||
|
# Retention policy
|
||||||
|
snapshot_preserve_min 2d
|
||||||
|
snapshot_preserve 14d
|
||||||
|
|
||||||
|
target_preserve_min no
|
||||||
|
target_preserve 20d 10w *m
|
||||||
|
|
||||||
|
snapshot_dir .snapshots
|
||||||
|
|
||||||
|
# Local snapshots
|
||||||
|
volume /
|
||||||
|
subvolume .
|
||||||
|
snapshot_name root
|
@ -7,7 +7,7 @@ echo -e "Starting update for Fedora..."
|
|||||||
cd ~/.dotfiles/provision
|
cd ~/.dotfiles/provision
|
||||||
|
|
||||||
# Install ansible and run playbook
|
# Install ansible and run playbook
|
||||||
ansible-playbook setup.yml -i hosts --ask-become-pass --tags "$1"
|
ansible-playbook setup.yml -i hosts --ask-become-pass --tags "$1" --skip-tags "once"
|
||||||
|
|
||||||
# Return to where you were
|
# Return to where you were
|
||||||
cd -
|
cd -
|
||||||
|
@ -2,3 +2,4 @@ readme.md
|
|||||||
.gitignore
|
.gitignore
|
||||||
.git
|
.git
|
||||||
provision
|
provision
|
||||||
|
additional-setup.md
|
||||||
|
@ -36,4 +36,24 @@ Wireguard is nice for a home vpn.
|
|||||||
sudo nmcli connection import type wireguard file /etc/wireguard/your-wg-file.conf
|
sudo nmcli connection import type wireguard file /etc/wireguard/your-wg-file.conf
|
||||||
```
|
```
|
||||||
|
|
||||||
The vpn can be enable/disabled through gnome.
|
The vpn can be enable/disabled through gnome.
|
||||||
|
|
||||||
|
## btrbk
|
||||||
|
|
||||||
|
[btrbk](https://github.com/digint/btrbk) is used to create (currently only local) snapshots of the root and user volumes.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo btrbk -c ~/.config/btrbk/home_btrbk.conf -v run # creates user backups and snapshots
|
||||||
|
sudo btrbk -c ~/.config/btrbk/root_btrbk.conf -v run # creates root snapshots
|
||||||
|
```
|
||||||
|
|
||||||
|
## Automount network drive with fstab
|
||||||
|
|
||||||
|
Fstab can be mounted when the network drive is accessed. This is done the "engi" home server.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo mkdir -p /mnt/engi
|
||||||
|
|
||||||
|
# Add following line to fstab
|
||||||
|
//<server-ip>/engi /mnt/engi cifs uid=1000,credentials=/home/tstarr/.smb,iocharset=utf8,noauto,x-systemd.automount 0 0
|
||||||
|
```
|
@ -24,3 +24,20 @@
|
|||||||
state: present
|
state: present
|
||||||
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
|
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
|
||||||
become: true
|
become: true
|
||||||
|
|
||||||
|
- name: Create btrbk snapshot directories
|
||||||
|
tags: ["once"]
|
||||||
|
block:
|
||||||
|
- file:
|
||||||
|
path: /.snapshots
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0775
|
||||||
|
- file:
|
||||||
|
path: /home/.snapshots
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0775
|
||||||
|
become: true
|
Loading…
x
Reference in New Issue
Block a user