btrbk: option to disable timer

This commit is contained in:
Daniel Langbein 2023-11-18 12:16:47 +01:00
parent 13b7c922e7
commit f423383ca2
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
3 changed files with 11 additions and 5 deletions

View File

@ -26,6 +26,7 @@ in
yoda.btrbkBackups = [
{
instance = "remote-backup-ssd";
enable = false;
lz4 = false;
ssh_identity = "/mnt/backup/rootNas_ed25519";
volume = "ssh://rootnas/jc-data";
@ -35,6 +36,7 @@ in
}
{
instance = "remote-backup-hdd";
enable = false;
lz4 = false;
ssh_identity = "/mnt/backup/rootNas_ed25519";
volume = "ssh://rootnas/mnt/data/jc-data";

View File

@ -13,12 +13,15 @@ in
type = types.listOf types.attrs;
default = [];
example = [{
instance = "local-backup-ssd";
# Optional.
# Can be used to disable timer.
#enable = false;
# 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";
target = "/mnt/backup/snap";
@ -47,8 +50,7 @@ in
# `services.btrbk.instances` template.
{
"${x.instance}" = {
#onCalendar = null;
onCalendar = "00:05";
onCalendar = if (x.enable or true) then "00:05" else null;
settings = {
timestamp_format = "long";
stream_compress = mkIf ((x.lz4 or false) && strings.hasPrefix "ssh://" x.volume) "lz4";

View File

@ -14,6 +14,9 @@ in
default = [];
example = [{
instance = "local-snapshot-ssd";
# Optional.
# Can be used to disable timer.
#enable = false;
volume = "/jc-data";
snapshot_dir = "/snap";
subvolume = {
@ -41,8 +44,7 @@ in
# `services.btrbk.instances` template.
{
"${x.instance}" = {
#onCalendar = null;
onCalendar = "hourly";
onCalendar = if (x.enable or true) then "hourly" else null;
settings = {
timestamp_format = "long";