70 lines
1.8 KiB
Nix
70 lines
1.8 KiB
Nix
{ ... }: {
|
|
services.btrbk = {
|
|
instances = {
|
|
/*
|
|
home = {
|
|
settings = {
|
|
snapshot_preserve = "24h 14d 4w 12m";
|
|
snapshot_preserve_min = "latest";
|
|
|
|
# don't auto cleanup target
|
|
target_preserve_min = "all";
|
|
|
|
volume."/" = {
|
|
snapshot_dir = ".btrbk";
|
|
subvolume = {
|
|
home = {
|
|
snapshot_create = "always";
|
|
};
|
|
};
|
|
target = "/run/media/me/backup/morpheus";
|
|
};
|
|
};
|
|
};
|
|
*/
|
|
|
|
# local snapshots:
|
|
# - create hourly
|
|
# - keep hourly for 4 days and daily forever
|
|
home_local = {
|
|
onCalendar = "hourly";
|
|
settings = {
|
|
snapshot_preserve = "96h *d";
|
|
snapshot_preserve_min = "latest";
|
|
volume."/" = {
|
|
snapshot_dir = "/home/.btrbk";
|
|
subvolume.home = {
|
|
snapshot_create = "always";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# backup snapshots to backup drive
|
|
# - keep all hourly and the last 14 days of daily snapshots on the local disk
|
|
# - keep 14 daily, 8 weekly and all monthly snapshots on the backup drive
|
|
# - don't create new snapshots
|
|
# - TODO: trigger on mount
|
|
home_external = {
|
|
# disable systemd timer
|
|
onCalendar = null;
|
|
settings = {
|
|
snapshot_preserve = "*h 14d";
|
|
snapshot_preserve_min = "latest";
|
|
|
|
target_preserve = "14d 8w *m";
|
|
target_preserve_min = "2d";
|
|
|
|
volume."/" = {
|
|
snapshot_dir = "/home/.btrbk";
|
|
subvolume.home = {
|
|
snapshot_create = "no";
|
|
};
|
|
target = "/run/media/me/backup/morpheus";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|