summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-01-05 21:47:55 +0100
committertv <tv@krebsco.de>2016-01-05 21:47:55 +0100
commite09559bb786c7cf639dc1428bbe2ed6ba7ced9fb (patch)
tree5037bdbf9263064888b7fb73d76fb9aebcde2f01
parent8c365dbe9b4549400a03ca75aef18e23a4648681 (diff)
krebs.backup.plans.*.{snapshots,startAt} += default
-rw-r--r--krebs/3modules/backup.nix10
-rw-r--r--tv/2configs/backup.nix21
2 files changed, 9 insertions, 22 deletions
diff --git a/krebs/3modules/backup.nix b/krebs/3modules/backup.nix
index 01bb16a2b..20bc5dee0 100644
--- a/krebs/3modules/backup.nix
+++ b/krebs/3modules/backup.nix
@@ -28,9 +28,17 @@ let
type = types.krebs.file-location;
};
startAt = mkOption {
- type = types.str;
+ default = "hourly";
+ type = types.str; # TODO systemd.time(7)'s calendar event
};
snapshots = mkOption {
+ default = {
+ hourly = { format = "%Y-%m-%dT%H"; retain = 4; };
+ daily = { format = "%Y-%m-%d"; retain = 7; };
+ weekly = { format = "%YW%W"; retain = 4; };
+ monthly = { format = "%Y-%m"; retain = 12; };
+ yearly = { format = "%Y"; };
+ };
type = types.attrsOf (types.submodule {
options = {
format = mkOption {
diff --git a/tv/2configs/backup.nix b/tv/2configs/backup.nix
index 51d3bb8a7..4b31bc844 100644
--- a/tv/2configs/backup.nix
+++ b/tv/2configs/backup.nix
@@ -4,20 +4,8 @@ with lib;
krebs.backup.plans = addNames {
xu-test-cd = {
method = "push";
-
src = { host = config.krebs.hosts.xu; path = "/tmp/xu-test"; };
dst = { host = config.krebs.hosts.cd; path = "/tmp/backups/xu-test"; };
-
- #startAt = "0,6,12,18:00";
- startAt = "minutely";
- snapshots = {
- minutely = { format = "%Y-%m-%dT%H:%M"; retain = 5; };
- hourly = { format = "%Y-%m-%dT%H"; retain = 4; };
- daily = { format = "%Y-%m-%d"; retain = 7; };
- weekly = { format = "%YW%W"; retain = 4; };
- monthly = { format = "%Y-%m"; retain = 12; };
- yearly = { format = "%Y"; };
- };
};
#xu-test-wu = {
# method = "push";
@@ -27,15 +15,6 @@ with lib;
method = "pull";
src = { host = config.krebs.hosts.cd; path = "/tmp/cd-test"; };
dst = { host = config.krebs.hosts.xu; path = "/tmp/backups/cd-test"; };
- startAt = "minutely";
- snapshots = {
- minutely = { format = "%Y-%m-%dT%H:%M"; retain = 5; };
- hourly = { format = "%Y-%m-%dT%H"; retain = 4; };
- daily = { format = "%Y-%m-%d"; retain = 7; };
- weekly = { format = "%YW%W"; retain = 4; };
- monthly = { format = "%Y-%m"; retain = 12; };
- yearly = { format = "%Y"; };
- };
};
};