summaryrefslogtreecommitdiffstats
path: root/lass/2configs/backups.nix
blob: 7d3046d431f5cf491bdaebf4c8ae3dc17b4a8642 (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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{ config, lib, ... }:
with config.krebs.lib;
{

  krebs.backup.plans = {
  } // mapAttrs (_: recursiveUpdate {
    snapshots = {
      daily    = { format = "%Y-%m-%d"; retain =  7; };
      weekly   = { format = "%YW%W";    retain =  4; };
      monthly  = { format = "%Y-%m";    retain = 12; };
      yearly   = { format = "%Y";                    };
    };
  }) {
    dishfire-http-prism = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.prism;    path = "/bku/dishfire-http"; };
      startAt = "03:00";
    };
    dishfire-http-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.mors;     path = "/bku/dishfire-http"; };
      startAt = "03:05";
    };
    dishfire-http-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.uriel;    path = "/bku/dishfire-http"; };
      startAt = "03:10";
    };
    dishfire-sql-prism = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.prism;    path = "/bku/dishfire-sql"; };
      startAt = "03:15";
    };
    dishfire-sql-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.mors;     path = "/bku/dishfire-sql"; };
      startAt = "03:20";
    };
    dishfire-sql-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.uriel;    path = "/bku/dishfire-sql"; };
      startAt = "03:25";
    };
    prism-bitlbee-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/var/lib/bitlbee"; };
      dst = { host = config.krebs.hosts.mors; path = "/bku/prism-bitlbee"; };
      startAt = "03:25";
    };
    prism-bitlbee-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/var/lib/bitlbee"; };
      dst = { host = config.krebs.hosts.uriel; path = "/bku/prism-bitlbee"; };
      startAt = "03:25";
    };
    prism-chat-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/home/chat"; };
      dst = { host = config.krebs.hosts.mors;  path = "/bku/prism-chat"; };
      startAt = "03:30";
    };
    prism-chat-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/home/chat"; };
      dst = { host = config.krebs.hosts.uriel; path = "/bku/prism-chat"; };
      startAt = "03:35";
    };
    prism-sql-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.mors;  path = "/bku/prism-sql_dumps"; };
      startAt = "03:40";
    };
    prism-sql-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.uriel; path = "/bku/prism-sql_dumps"; };
      startAt = "03:45";
    };
    prism-http-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.mors;  path = "/bku/prism-http"; };
      startAt = "03:50";
    };
    prism-http-uriel = {
      method = "pull";
      src = { host = config.krebs.hosts.prism; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.uriel; path = "/bku/prism-http"; };
      startAt = "03:55";
    };
    uriel-home-mors = {
      method = "pull";
      src = { host = config.krebs.hosts.uriel; path = "/home"; };
      dst = { host = config.krebs.hosts.mors;  path = "/bku/uriel-home"; };
      startAt = "04:00";
    };
    mors-home-uriel = {
      method = "push";
      src = { host = config.krebs.hosts.mors;  path = "/home"; };
      dst = { host = config.krebs.hosts.uriel; path = "/bku/mors-home"; };
      startAt = "05:00";
    };
    dishfire-http-helios = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/srv/http"; };
      dst = { host = config.krebs.hosts.helios;   path = "/bku/dishfire-http"; };
      startAt = "12:00";
    };
    dishfire-sql-helios = {
      method = "pull";
      src = { host = config.krebs.hosts.dishfire; path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.helios;   path = "/bku/dishfire-sql"; };
      startAt = "12:15";
    };
    prism-sql-helios = {
      method = "pull";
      src = { host = config.krebs.hosts.prism;  path = "/bku/sql_dumps"; };
      dst = { host = config.krebs.hosts.helios; path = "/bku/prism-sql_dumps"; };
      startAt = "12:30";
    };
    prism-http-helios = {
      method = "pull";
      src = { host = config.krebs.hosts.prism;  path = "/srv/http"; };
      dst = { host = config.krebs.hosts.helios; path = "/bku/prism-http"; };
      startAt = "12:45";
    };
  };
}