summaryrefslogtreecommitdiffstats
path: root/makefu/2configs/backup.nix
diff options
context:
space:
mode:
authorlassulus <lass@aidsballs.de>2016-02-06 18:45:38 +0100
committerlassulus <lass@aidsballs.de>2016-02-06 18:45:38 +0100
commitfe586d704eed42421ad3fe0d140c0caa64764a68 (patch)
treea07d0c4d09ef780f703ae03435d51ac60019c956 /makefu/2configs/backup.nix
parent138bdc6bf6a18a59cf47d2d2db7c4e7640f50641 (diff)
parentc784d271c5dc8783e5e6308baf4f6dd26430bfca (diff)
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'makefu/2configs/backup.nix')
-rw-r--r--makefu/2configs/backup.nix30
1 files changed, 30 insertions, 0 deletions
diff --git a/makefu/2configs/backup.nix b/makefu/2configs/backup.nix
new file mode 100644
index 000000000..ed6d1f4a7
--- /dev/null
+++ b/makefu/2configs/backup.nix
@@ -0,0 +1,30 @@
+{ config, lib, ... }:
+with lib;
+let
+ 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;
+ path = defaultBackupDir + 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 = addNames {
+ wry-to-omo_var-www = defaultPull wry "/var/www";
+ };
+}