This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

superconfig / machines / prism / backup.nix
977 B 37 lines
1{ config, lib, pkgs, ... }: 2{ 3 services.postgresqlBackup.enable = true; 4 5 systemd.services.borgbackup-job-hetzner.serviceConfig.ReadWritePaths = [ "/var/log/telegraf" ]; 6 7 services.borgbackup.jobs.hetzner = { 8 paths = [ 9 "/var/backup" 10 ]; 11 exclude = [ 12 "*.pyc" 13 ]; 14 repo = "u364341@u364341.your-storagebox.de:/./hetzner"; 15 encryption.mode = "none"; 16 compression = "auto,zstd"; 17 startAt = "*-*-* 02:00:00"; 18 # TODO: change backup key 19 environment.BORG_RSH = "ssh -oPort=23 -i ${"${config.krebs.secret.directory}/borgbackup.ssh.id25519"}"; 20 preHook = '' 21 set -x 22 ''; 23 24 postHook = '' 25 cat > /var/log/telegraf/borgbackup-job-hetzner.service <<EOF 26 task,frequency=daily last_run=$(date +%s)i,state="$([[ $exitStatus == 0 ]] && echo ok || echo fail)" 27 EOF 28 ''; 29 30 prune.keep = { 31 within = "1d"; # Keep all archives from the last day 32 daily = 7; 33 weekly = 4; 34 monthly = 0; 35 }; 36 }; 37}