setup hetzner backups
This commit is contained in:
parent
577043fb71
commit
6a3753a41d
1 changed files with 39 additions and 0 deletions
39
void.nix
39
void.nix
|
|
@ -105,6 +105,45 @@
|
|||
Requires = "external.mount";
|
||||
};
|
||||
};
|
||||
services.borgbackup.jobs."hetzner" = {
|
||||
paths = [
|
||||
"/home"
|
||||
"/var"
|
||||
"/pile"
|
||||
];
|
||||
exclude = [
|
||||
"/home/*/.local/share/Steam"
|
||||
"**/*cache"
|
||||
"**/*Cache"
|
||||
"**/*trash"
|
||||
"**/*Trash"
|
||||
"/home/*/.mozilla/firefox"
|
||||
"/home/*/GOG Games"
|
||||
"**/target"
|
||||
"**/result"
|
||||
"/var/log"
|
||||
];
|
||||
repo = "ssh://u480566-sub1@u480566-sub1.your-storagebox.de:23/./repo";
|
||||
encryption = {
|
||||
mode = "repokey-blake2";
|
||||
passCommand = "cat /root/borgbackup/hetzner_passphrase";
|
||||
};
|
||||
environment.BORG_RSH = "ssh -i /root/borgbackup/hetzner_ssh_key";
|
||||
compression = "auto,lzma";
|
||||
startAt = "daily";
|
||||
persistentTimer = true;
|
||||
extraCreateArgs = ["--stats" "--info" "--list" "--filter" "AMEC"];
|
||||
extraPruneArgs = ["--stats" "--info" "--list"];
|
||||
prune.keep = {
|
||||
within = "1d";
|
||||
daily = 7;
|
||||
weekly = 4;
|
||||
monthly = 12;
|
||||
};
|
||||
preHook = ''
|
||||
/bin/sh -c 'while ! /run/current-system/sw/bin/ping -c1 google.com; do sleep 1; done'
|
||||
'';
|
||||
};
|
||||
|
||||
# postgresql backup
|
||||
services.postgresqlBackup = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue