stockholm/makefu/2configs/backup.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

2017-05-12 09:32:12 +00:00
{ config, lib, pkgs, ... }:
2016-10-20 18:54:38 +00:00
with import <stockholm/lib>;
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
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}";
};
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 {
krebs.backup.plans = {
2017-03-31 11:01:26 +00:00
# wry-to-omo_root = defaultPull config.krebs.hosts.wry "/";
2017-01-09 14:58:43 +00:00
gum-to-omo_root = defaultPull config.krebs.hosts.gum "/";
# wolf-to-omo_root = defaultPull config.krebs.hosts.wolf "/";
};
2017-05-12 09:32:12 +00:00
environment.systemPackages = [
pkgs.borgbackup
];
}