mirror of
https://github.com/Death916/nixconfig.git
synced 2026-04-10 02:54:39 -07:00
add pgdump for juicefs and increase dlays for restic
This commit is contained in:
parent
c58fa02f56
commit
bb8bfa2f0a
3 changed files with 25 additions and 5 deletions
|
|
@ -27,9 +27,9 @@
|
|||
"--exclude-caches"
|
||||
];
|
||||
timerConfig = {
|
||||
OnCalendar = "hourly";
|
||||
OnCalendar = "*:00";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "20m";
|
||||
RandomizedDelaySec = "15m";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
timerConfig = {
|
||||
OnCalendar = "*:40";
|
||||
Persistent = true;
|
||||
RandomizedDelaySec = "10m";
|
||||
RandomizedDelaySec = "15m";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue