2017-05-12 11:32:12 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2016-10-20 20:54:38 +02:00
|
|
|
with import <stockholm/lib>;
|
2016-02-04 11:16:17 +01:00
|
|
|
let
|
2016-10-19 12:17:32 +02:00
|
|
|
# preparation:
|
|
|
|
# mkdir -p defaultBackupDir/host.name/src
|
|
|
|
# as root on omo:
|
|
|
|
# ssh-copy-id root@src
|
2016-02-04 11:16:17 +01: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 12:17:32 +02:00
|
|
|
path = "${defaultBackupDir}/${host.name}${src}";
|
2016-02-04 11:16:17 +01: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 18:54:01 +01:00
|
|
|
krebs.backup.plans = {
|
2017-03-31 13:01:26 +02:00
|
|
|
# wry-to-omo_root = defaultPull config.krebs.hosts.wry "/";
|
2017-01-09 15:58:43 +01:00
|
|
|
gum-to-omo_root = defaultPull config.krebs.hosts.gum "/";
|
2017-11-08 10:55:09 +01:00
|
|
|
gum-dl-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/download" )//
|
|
|
|
{
|
|
|
|
dst.path = "/media/cryptX/backup/gum/var-download";
|
|
|
|
dst.host = defaultBackupServer;
|
|
|
|
startAt = "19:00";
|
|
|
|
};
|
|
|
|
gum-owncloud-to-omo_external = (defaultPull config.krebs.hosts.gum "/var/www/o.euer.krebsco.de" )//
|
|
|
|
{
|
|
|
|
dst.path = "/media/cryptX/backup/gum/var-www-o.euer.krebsco.de";
|
|
|
|
dst.host = defaultBackupServer;
|
|
|
|
|
|
|
|
startAt = "05:00";
|
|
|
|
};
|
2017-08-16 12:15:06 +02:00
|
|
|
# wolf-to-omo_root = defaultPull config.krebs.hosts.wolf "/";
|
2016-02-04 11:16:17 +01:00
|
|
|
};
|
2017-05-12 11:32:12 +02:00
|
|
|
environment.systemPackages = [
|
|
|
|
pkgs.borgbackup
|
|
|
|
];
|
2016-02-04 11:16:17 +01:00
|
|
|
}
|