chunk/borg: fix persistentTimer in the wrong place

This commit is contained in:
cy 2024-12-30 14:56:35 -05:00
parent 1ffcc8d020
commit bed60c09d7

View file

@ -4,63 +4,61 @@
... ...
}: }:
{ {
services.borgbackup.jobs = { services.borgbackup.crashRsync = {
# systemd.timer(5) # systemd.timer(5)
persistentTimer = true; persistentTimer = true;
crashRsync = { paths = [
paths = [ "/root"
"/root" "/home"
"/home" "/var/backup"
"/var/backup" "/var/lib"
"/var/lib" "/opt"
"/opt" "/etc"
"/etc" "/vw-data"
"/vw-data" ];
]; exclude = [
exclude = [ "**/.cache"
"**/.cache" "**/node_modules"
"**/node_modules" "**/cache"
"**/cache" "**/Cache"
"**/Cache" "/var/lib/docker"
"/var/lib/docker" "/var/lib/containers/cache"
"/var/lib/containers/cache" "/var/lib/containers/overlay*"
"/var/lib/containers/overlay*" "/var/lib/systemd"
"/var/lib/systemd" "**/.rustup"
"**/.rustup" "**/.cargo"
"**/.cargo" "**/.docker"
"**/.docker" ];
]; repo = "de3911@de3911.rsync.net:borg/crash";
repo = "de3911@de3911.rsync.net:borg/crash"; encryption = {
encryption = { mode = "repokey-blake2";
mode = "repokey-blake2"; passCommand = "cat ${config.sops.secrets."borg/rsyncnet".path}";
passCommand = "cat ${config.sops.secrets."borg/rsyncnet".path}";
};
environment = {
BORG_RSH = ''ssh -i ${config.sops.secrets."rsyncnet/id_ed25519".path}'';
BORG_REMOTE_PATH = "borg1";
BORG_EXIT_CODES = "modern";
};
compression = "auto,zstd,8";
startAt = "hourly";
extraCreateArgs = [
"--stats"
"-x"
];
# warnings are often not that serious
failOnWarnings = false;
postHook = ''
${pkgs.curl}/bin/curl -u $(cat ${
config.sops.secrets."services/ntfy".path
}) -d "chunk: backup completed with exit code: $exitStatus
$(journalctl -u borgbackup-job-crashRsync.service|tail -n 5)" \
https://ntfy.cything.io/chunk
'';
prune.keep = {
within = "2d";
daily = 365;
};
extraPruneArgs = [ "--stats" ];
}; };
environment = {
BORG_RSH = ''ssh -i ${config.sops.secrets."rsyncnet/id_ed25519".path}'';
BORG_REMOTE_PATH = "borg1";
BORG_EXIT_CODES = "modern";
};
compression = "auto,zstd,8";
startAt = "hourly";
extraCreateArgs = [
"--stats"
"-x"
];
# warnings are often not that serious
failOnWarnings = false;
postHook = ''
${pkgs.curl}/bin/curl -u $(cat ${
config.sops.secrets."services/ntfy".path
}) -d "chunk: backup completed with exit code: $exitStatus
$(journalctl -u borgbackup-job-crashRsync.service|tail -n 5)" \
https://ntfy.cything.io/chunk
'';
prune.keep = {
within = "2d";
daily = 365;
};
extraPruneArgs = [ "--stats" ];
}; };
} }