krebs.backup.plans.*.{snapshots,startAt} += default

This commit is contained in:
tv 2016-01-05 21:47:55 +01:00
parent 8c365dbe9b
commit e09559bb78
2 changed files with 9 additions and 22 deletions

View File

@ -28,9 +28,17 @@ let
type = types.krebs.file-location; type = types.krebs.file-location;
}; };
startAt = mkOption { startAt = mkOption {
type = types.str; default = "hourly";
type = types.str; # TODO systemd.time(7)'s calendar event
}; };
snapshots = mkOption { 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 { type = types.attrsOf (types.submodule {
options = { options = {
format = mkOption { format = mkOption {

View File

@ -4,20 +4,8 @@ with lib;
krebs.backup.plans = addNames { krebs.backup.plans = addNames {
xu-test-cd = { xu-test-cd = {
method = "push"; method = "push";
src = { host = config.krebs.hosts.xu; path = "/tmp/xu-test"; }; src = { host = config.krebs.hosts.xu; path = "/tmp/xu-test"; };
dst = { host = config.krebs.hosts.cd; path = "/tmp/backups/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 = { #xu-test-wu = {
# method = "push"; # method = "push";
@ -27,15 +15,6 @@ with lib;
method = "pull"; method = "pull";
src = { host = config.krebs.hosts.cd; path = "/tmp/cd-test"; }; src = { host = config.krebs.hosts.cd; path = "/tmp/cd-test"; };
dst = { host = config.krebs.hosts.xu; path = "/tmp/backups/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"; };
};
}; };
}; };