2016-02-04 10:16:17 +00:00
|
|
|
{ config, lib, ... }:
|
2016-02-14 15:43:44 +00:00
|
|
|
with config.krebs.lib;
|
2016-02-04 10:16:17 +00:00
|
|
|
let
|
2016-10-19 10:17:32 +00:00
|
|
|
# preparation:
|
|
|
|
# mkdir -p defaultBackupDir/host.name/src
|
|
|
|
# as root on omo:
|
|
|
|
# ssh-copy-id root@src
|
2016-02-04 10:16:17 +00:00
|
|
|
startAt = "0,6,12,18:00";
|
|
|
|
defaultBackupServer = config.krebs.hosts.omo;
|
|
|
|
defaultBackupDir = "/home/backup";
|
|
|
|
defaultPull = host: src: {
|
|
|
|
method = "pull";
|
|
|
|
src = {
|
|
|
|
inherit host;
|
|
|
|
path = src;
|
|
|
|
};
|
|
|
|
dst = {
|
|
|
|
host = defaultBackupServer;
|
2016-10-19 10:17:32 +00:00
|
|
|
path = "${defaultBackupDir}/${host.name}${src}";
|
2016-02-04 10:16:17 +00:00
|
|
|
};
|
|
|
|
startAt = "0,6,12,18:00";
|
|
|
|
snapshots = {
|
|
|
|
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"; };
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
2016-02-06 17:54:01 +00:00
|
|
|
krebs.backup.plans = {
|
2016-10-19 10:17:32 +00:00
|
|
|
wry-to-omo_var-www = defaultPull config.krebs.hosts.wry "/";
|
2016-02-04 10:16:17 +00:00
|
|
|
};
|
|
|
|
}
|