seperated psql backup into multiple files
This commit is contained in:
parent
5c78b2f2e2
commit
73836ebb0b
3 changed files with 36 additions and 12 deletions
|
|
@ -1,5 +1,20 @@
|
|||
{ pkgs, config, ... }:
|
||||
{
|
||||
|
||||
services.postgresql = {
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensurePermissions = {
|
||||
"DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
services.postgresqlBackup.databases = [ "nextcloud" ];
|
||||
|
||||
services.nextcloud = {
|
||||
autoUpdateApps.enable = true;
|
||||
enable = true;
|
||||
|
|
|
|||
|
|
@ -3,32 +3,39 @@
|
|||
services.postgresql = {
|
||||
enable = true;
|
||||
package = pkgs.postgresql_14;
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensurePermissions = {
|
||||
"DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
#ensureDatabases = [ "nextcloud" ];
|
||||
#ensureUsers = [
|
||||
# {
|
||||
# name = "nextcloud";
|
||||
# ensurePermissions = {
|
||||
# "DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
# };
|
||||
# }
|
||||
#];
|
||||
};
|
||||
|
||||
services.postgresqlBackup = {
|
||||
enable = true;
|
||||
startAt = "*-*-* *:30:00";
|
||||
compression = "zstd";
|
||||
databases = [
|
||||
"postgres"
|
||||
];
|
||||
};
|
||||
|
||||
services.logrotate = {
|
||||
enable = true;
|
||||
paths.postgresqlBackup = {
|
||||
path = "${config.services.postgresqlBackup.location}/all.sql.zstd";
|
||||
path = "${config.services.postgresqlBackup.location}/*.sql.zstd";
|
||||
user = "postgres";
|
||||
group = "postgres";
|
||||
keep = 24;
|
||||
frequency = "hourly";
|
||||
extraConfig = "extension = .zstd";
|
||||
extraConfig = ''
|
||||
dateext
|
||||
dateformat _%Y-%m-%d:%H
|
||||
extension = .zstd
|
||||
'';
|
||||
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,8 @@ in
|
|||
authentication = "host tandoor tandoor 10.88.0.0/16 md5";
|
||||
};
|
||||
|
||||
services.postgresqlBackup.databases = [ "tandoor" ];
|
||||
|
||||
networking.firewall.interfaces.cni-podman0.allowedTCPPorts = [ 5432 ];
|
||||
|
||||
services.nginx.virtualHosts."${domain}" = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue