modules/backup: fix backup times per server
This commit is contained in:
parent
c00a7d710a
commit
5e3d297d6c
1 changed files with 14 additions and 1 deletions
|
@ -39,6 +39,15 @@ let
|
||||||
};
|
};
|
||||||
|
|
||||||
repo = "rsync.net:backups/hosts";
|
repo = "rsync.net:backups/hosts";
|
||||||
|
|
||||||
|
backupTimes = {
|
||||||
|
"Infini-FRAMEWORK" = "00:00";
|
||||||
|
"Infini-OPTIPLEX" = "01:00";
|
||||||
|
"Infini-SERVER" = "02:00";
|
||||||
|
"Infini-DESKTOP" = "03:00";
|
||||||
|
"Infini-SD" = "04:00";
|
||||||
|
|
||||||
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
users.groups."borg" = { };
|
users.groups."borg" = { };
|
||||||
|
@ -57,7 +66,7 @@ in
|
||||||
paths = "/persist";
|
paths = "/persist";
|
||||||
inherit repo;
|
inherit repo;
|
||||||
exclude = map (append paths) excludes';
|
exclude = map (append paths) excludes';
|
||||||
startAt = "daily";
|
startAt = "*-*-* ${backupTimes.${config.networking.hostName}}";
|
||||||
prune.keep = {
|
prune.keep = {
|
||||||
within = "1d"; # Keep all archives from the last day
|
within = "1d"; # Keep all archives from the last day
|
||||||
daily = 7;
|
daily = 7;
|
||||||
|
@ -65,4 +74,8 @@ in
|
||||||
monthly = -1; # Keep at least one archive for each month
|
monthly = -1; # Keep at least one archive for each month
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
systemd.timers."borgbackup-job-persist" = {
|
||||||
|
requires = [ "network-online.target" ];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue