mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
yodaHedgehog: btrbk config
This commit is contained in:
parent
405a6a9981
commit
13b7c922e7
46
hosts/yodaHedgehog/btrbk-config.nix
Normal file
46
hosts/yodaHedgehog/btrbk-config.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{ config, pkgs, ... }:
|
||||
let
|
||||
# TODO: Remove duplicate variables below (reuse from yodaNas config).
|
||||
ssd-subvolumes = {
|
||||
"arch.p1st.de" = {};
|
||||
"blogger.privacy1st.de" = {};
|
||||
"changedetection.p1st.de" = {};
|
||||
"cloud.privacy1st.de" = {};
|
||||
"git.privacy1st.de" = {};
|
||||
"mastodon-toot-follower.privacy1st.de" = {};
|
||||
"money.p1st.de" = {};
|
||||
"music.privacy1st.de" = {};
|
||||
"paste.p1st.de" = {};
|
||||
"proxy" = {};
|
||||
"recipe.privacy1st.de" = {};
|
||||
"traggo.privacy1st.de" = {};
|
||||
};
|
||||
hdd-subvolumes = {
|
||||
"cloud.privacy1st.de" = {};
|
||||
# MediaKollektiv: 796 GiB
|
||||
"cloud.media-kollektiv.eu" = {};
|
||||
};
|
||||
in
|
||||
{
|
||||
# TODO: Enable lz4 when yodaHedgehog no longer has direct LAN connection.
|
||||
yoda.btrbkBackups = [
|
||||
{
|
||||
instance = "remote-backup-ssd";
|
||||
lz4 = false;
|
||||
ssh_identity = "/mnt/backup/rootNas_ed25519";
|
||||
volume = "ssh://rootnas/jc-data";
|
||||
snapshot_dir = "/snap";
|
||||
target = "/mnt/backup/snap";
|
||||
subvolume = ssd-subvolumes;
|
||||
}
|
||||
{
|
||||
instance = "remote-backup-hdd";
|
||||
lz4 = false;
|
||||
ssh_identity = "/mnt/backup/rootNas_ed25519";
|
||||
volume = "ssh://rootnas/mnt/data/jc-data";
|
||||
snapshot_dir = "/mnt/data/snap2";
|
||||
target = "/mnt/backup/snap2";
|
||||
subvolume = hdd-subvolumes;
|
||||
}
|
||||
];
|
||||
}
|
@ -18,8 +18,8 @@
|
||||
../../modules/sendmail-mta.nix
|
||||
../../modules/journalwatch.nix
|
||||
|
||||
# TODO
|
||||
#../../modules/btrbk
|
||||
../../modules/btrbk
|
||||
./btrbk-config.nix
|
||||
../../modules/de-p1st-monitor.nix
|
||||
#../../modules/spin-down.nix
|
||||
|
||||
|
@ -246,7 +246,7 @@ Another remote backup server periodically pulls snapshots to create remote backu
|
||||
cat > ~/btrbk.cfg <<'EOF'
|
||||
timestamp_format long
|
||||
stream_compress lz4
|
||||
ssh_identity /mnt/backup/rootnas_ed25519
|
||||
ssh_identity /mnt/backup/rootNas_ed25519
|
||||
|
||||
# Create backups.
|
||||
target_preserve_min no
|
||||
@ -255,11 +255,11 @@ target_preserve 7d 4w 6m
|
||||
# Hourly backups -> @hourly cron entry
|
||||
#target_preserve 24h 7d 4w 6m
|
||||
|
||||
# Don't create or delete snapshots on remote server "rootnas".
|
||||
# Don't create or delete snapshots on remote server "rootNas".
|
||||
snapshot_preserve_min all
|
||||
snapshot_create no
|
||||
|
||||
volume ssh://rootnas/jc-data
|
||||
volume ssh://rootNas/jc-data
|
||||
snapshot_dir /snap
|
||||
target /mnt/backup/snap
|
||||
subvolume arch.p1st.de
|
||||
@ -274,7 +274,7 @@ volume ssh://rootnas/jc-data
|
||||
subvolume proxy
|
||||
subvolume recipe.privacy1st.de
|
||||
subvolume traggo.privacy1st.de
|
||||
volume ssh://rootnas/mnt/data/jc-data
|
||||
volume ssh://rootNas/mnt/data/jc-data
|
||||
snapshot_dir /mnt/data/snap
|
||||
target /mnt/backup/snap2
|
||||
subvolume cloud.privacy1st.de
|
||||
|
@ -16,6 +16,8 @@ in
|
||||
# Optional.
|
||||
# If this is `true` and `volume` starts with `ssh://`, `lz4` transport compression is enabled.
|
||||
lz4 = true;
|
||||
# Optional.
|
||||
#ssh_identity = /root/.ssh/rootNas_ed25519;
|
||||
instance = "local-backup-ssd";
|
||||
volume = "/jc-data";
|
||||
snapshot_dir = "/snap";
|
||||
@ -50,6 +52,7 @@ in
|
||||
settings = {
|
||||
timestamp_format = "long";
|
||||
stream_compress = mkIf ((x.lz4 or false) && strings.hasPrefix "ssh://" x.volume) "lz4";
|
||||
ssh_identity = mkIf (x?ssh_identity) x.ssh_identity;
|
||||
|
||||
# Create backups.
|
||||
target_preserve_min = daily.preserve-min;
|
||||
|
Loading…
Reference in New Issue
Block a user