mirror of
https://codeberg.org/privacy1st/nix-git
synced 2024-11-21 22:03:19 +01:00
refactor btrbk
This commit is contained in:
parent
c02ee24df7
commit
d0614fa608
@ -1,3 +1,15 @@
|
|||||||
|
# For each instance, a service and timer will be created:
|
||||||
|
# systemctl list-unit-files | grep btrbk
|
||||||
|
# #=> btrbk-<instance-name>.service
|
||||||
|
# #=> btrbk-<instance-name>.timer
|
||||||
|
#
|
||||||
|
# If onCalendar is set to `null`, one can manually execute btrbk with
|
||||||
|
# sudo systemctl start btrbk-<instance-name>.service
|
||||||
|
|
||||||
|
# Print generated systemd unit file
|
||||||
|
# cat "$(systemctl show -P FragmentPath btrbk-<instance-name>.service)"
|
||||||
|
# #=> ExecStart=/nix/store/53nvbl1c0w14524j7v3fpn9py31yi2hb-btrbk-0.32.6/bin/btrbk -c /etc/btrbk/local-backup.conf run
|
||||||
|
|
||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
let
|
let
|
||||||
ssd-subvolumes = {
|
ssd-subvolumes = {
|
||||||
@ -19,20 +31,10 @@ let
|
|||||||
# MediaKollektiv: 796 GiB
|
# MediaKollektiv: 796 GiB
|
||||||
"cloud.media-kollektiv.eu" = {};
|
"cloud.media-kollektiv.eu" = {};
|
||||||
};
|
};
|
||||||
|
preserve-hourly = "24h 7d 4w 6m";
|
||||||
|
preserve-daily = "7d 4w 6m";
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# For each instance, a service and timer will be created:
|
|
||||||
# systemctl list-unit-files | grep btrbk
|
|
||||||
# #=> btrbk-<instance-name>.service
|
|
||||||
# #=> btrbk-<instance-name>.timer
|
|
||||||
#
|
|
||||||
# If onCalendar is set to `null`, one can manually execute btrbk with
|
|
||||||
# sudo systemctl start btrbk-<instance-name>.service
|
|
||||||
|
|
||||||
# Print generated systemd unit file
|
|
||||||
# cat "$(systemctl show -P FragmentPath btrbk-<instance-name>.service)"
|
|
||||||
# #=> ExecStart=/nix/store/53nvbl1c0w14524j7v3fpn9py31yi2hb-btrbk-0.32.6/bin/btrbk -c /etc/btrbk/local-backup.conf run
|
|
||||||
|
|
||||||
services.btrbk = {
|
services.btrbk = {
|
||||||
extraPackages = [ pkgs.lz4 ];
|
extraPackages = [ pkgs.lz4 ];
|
||||||
# Lowest scheduling priority.
|
# Lowest scheduling priority.
|
||||||
@ -49,14 +51,14 @@ in
|
|||||||
#stream_compress = "lz4";
|
#stream_compress = "lz4";
|
||||||
|
|
||||||
snapshot_preserve_min = "2d";
|
snapshot_preserve_min = "2d";
|
||||||
snapshot_preserve = "24h 7d 4w 6m";
|
snapshot_preserve = preserve-hourly;
|
||||||
|
|
||||||
volume."/jc-data" = {
|
volume."/jc-data" = {
|
||||||
snapshot_dir = "/snap";
|
snapshot_dir = "/snap";
|
||||||
subvolume = ssd-subvolumes;
|
subvolume = ssd-subvolumes;
|
||||||
};
|
};
|
||||||
volume."/mnt/data/jc-data" = {
|
volume."/mnt/data/jc-data" = {
|
||||||
snapshot_dir = "/mnt/data/snap";
|
snapshot_dir = "/mnt/data/snap2";
|
||||||
subvolume = hdd-subvolumes;
|
subvolume = hdd-subvolumes;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -72,7 +74,7 @@ in
|
|||||||
|
|
||||||
# Create backups.
|
# Create backups.
|
||||||
target_preserve_min = "no";
|
target_preserve_min = "no";
|
||||||
target_preserve = "7d 4w 6m";
|
target_preserve = preserve-daily;
|
||||||
|
|
||||||
# Don't create or delete snapshots.
|
# Don't create or delete snapshots.
|
||||||
snapshot_preserve_min = "all";
|
snapshot_preserve_min = "all";
|
||||||
@ -84,7 +86,7 @@ in
|
|||||||
subvolume = ssd-subvolumes;
|
subvolume = ssd-subvolumes;
|
||||||
};
|
};
|
||||||
volume."/mnt/data/jc-data" = {
|
volume."/mnt/data/jc-data" = {
|
||||||
snapshot_dir = "/mnt/data/snap";
|
snapshot_dir = "/mnt/data/snap2";
|
||||||
target = "/mnt/backup/snap2";
|
target = "/mnt/backup/snap2";
|
||||||
subvolume = hdd-subvolumes;
|
subvolume = hdd-subvolumes;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user