summaryrefslogtreecommitdiffstats
path: root/tv/2configs/backup.nix
blob: decd8b28608130b3527e9665d696783132d6f18b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{ config, lib, ... }:
with config.krebs.lib;
{
  krebs.backup.plans = {
    nomic-home-xu = {
      method = "push";
      src = { host = config.krebs.hosts.nomic; path = "/home"; };
      dst = { host = config.krebs.hosts.xu;    path = "/bku/nomic-home"; };
      startAt = "05:00";
      snapshots = {
        daily    = { format = "%Y-%m-%d";    retain =  7; };
        weekly   = { format = "%YW%W";       retain =  4; };
        monthly  = { format = "%Y-%m";       retain = 12; };
        yearly   = { format = "%Y";                       };
      };
    };
    wu-home-xu = {
      method = "push";
      src = { host = config.krebs.hosts.wu; path = "/home"; };
      dst = { host = config.krebs.hosts.xu; path = "/bku/wu-home"; };
      startAt = "05:00";
      snapshots = {
        daily    = { format = "%Y-%m-%d";    retain =  7; };
        weekly   = { format = "%YW%W";       retain =  4; };
        monthly  = { format = "%Y-%m";       retain = 12; };
        yearly   = { format = "%Y";                       };
      };
    };
    xu-home-wu = {
      method = "push";
      src = { host = config.krebs.hosts.xu; path = "/home"; };
      dst = { host = config.krebs.hosts.wu; path = "/bku/xu-home"; };
      startAt = "06:00";
      snapshots = {
        daily    = { format = "%Y-%m-%d";    retain =  7; };
        weekly   = { format = "%YW%W";       retain =  4; };
        monthly  = { format = "%Y-%m";       retain = 12; };
        yearly   = { format = "%Y";                       };
      };
    };
  } // mapAttrs (_: recursiveUpdate {
    snapshots = {
      minutely = { format = "%Y-%m-%dT%H:%M"; retain = 3; };
      hourly   = { format = "%Y-%m-%dT%H";    retain = 3; };
      daily    = { format = "%Y-%m-%d";       retain = 3; };
    };
    startAt = null;
  }) {
    xu-test-push-xu = {
      method = "push";
      src = { host = config.krebs.hosts.xu; path = "/tmp/xu-bku-test-data"; };
      dst = { host = config.krebs.hosts.xu; path = "/bku/xu-test-push"; };
    };
    xu-test-pull-xu = {
      method = "pull";
      src = { host = config.krebs.hosts.xu; path = "/tmp/xu-bku-test-data"; };
      dst = { host = config.krebs.hosts.xu; path = "/bku/xu-test-pull"; };
    };
    xu-test-push-wu = {
      method = "push";
      src = { host = config.krebs.hosts.xu; path = "/tmp/xu-bku-test-data"; };
      dst = { host = config.krebs.hosts.wu; path = "/bku/xu-test-push"; };
    };
  };
}