add pgdump for juicefs and increase dlays for restic

This commit is contained in:
death916 2026-02-19 04:36:16 -08:00
parent c58fa02f56
commit bb8bfa2f0a
3 changed files with 25 additions and 5 deletions

View file

@ -27,9 +27,9 @@
"--exclude-caches"
];
timerConfig = {
OnCalendar = "hourly";
OnCalendar = "*:00";
Persistent = true;
RandomizedDelaySec = "20m";
RandomizedDelaySec = "15m";
};
};

View file

@ -30,7 +30,7 @@
timerConfig = {
OnCalendar = "*:40";
Persistent = true;
RandomizedDelaySec = "10m";
RandomizedDelaySec = "15m";
};
};

View file

@ -2,6 +2,27 @@
{
# Dump JuiceFS PostgreSQL metadata before backup
systemd.services."juicefs-metadata-dump" = {
serviceConfig = {
Type = "oneshot";
User = "root";
EnvironmentFile = "/etc/nixos/secrets/juicefs.env";
};
script = ''
${pkgs.docker}/bin/docker exec postgres-for-juicefs \
pg_dump -U death916 juicefs | ${pkgs.gzip}/bin/gzip > /root/juicefs-metadata.sql.gz
'';
};
systemd.timers."juicefs-metadata-dump" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "*:10";
Persistent = true;
};
};
services.restic.backups.orac = {
user = "root";
initialize = true;
@ -15,7 +36,6 @@
"/var/log/"
"/etc/"
"/mnt/myjfs/"
];
exclude = [
@ -36,7 +56,7 @@
timerConfig = {
OnCalendar = "*:20";
Persistent = true;
RandomizedDelaySec = "10m";
RandomizedDelaySec = "20m";
};
};