Fix postgresbackup

This commit is contained in:
Nathan McCarty 2022-09-27 01:32:20 -04:00
parent 6abfea39fa
commit 18205dbbff
Signed by: thatonelutenist
GPG Key ID: D70DA3DD4D1E9F96
1 changed files with 12 additions and 2 deletions

View File

@ -124,7 +124,8 @@
enable = true; enable = true;
compression = "none"; compression = "none";
backupAll = true; backupAll = true;
startAt = "OnCalendar=00/4:00"; # Every monring at 4 AM
startAt = "*-*-* 4:00:00";
}; };
# Setup a task to cleanup the database # Setup a task to cleanup the database
@ -136,9 +137,18 @@
}; };
path = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ]; path = with pkgs; [ matrix-synapse-tools.rust-synapse-compress-state ];
script = '' script = ''
synapse_auto_compressor -p "host=localhost user=postgres" -c 500 -n 100 synapse_auto_compressor -p "user=matrix-synapse password=synapse dbname=synapse host=localhost" -c 500 -n 100
''; '';
}; };
systemd.timers.synapse-db-cleanup = {
wantedBy = [ "timers.target" ];
partOf = [ "synapse-db-cleanup.service" ];
timerConfig = {
# Weekly on sunday mornings
OnCalendar = "Sun, 5:00";
Unit = "synapse-db-cleanup.service";
};
};
# Configure the vhost for the domain # Configure the vhost for the domain
services.nginx.virtualHosts = services.nginx.virtualHosts =