X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fprivate%2Fdatabases%2Fmariadb_replication.nix;h=52a34d3e20d9fc91671f7e7b766f93bce205f385;hb=6015a3b52c3b155ac444aeb39950c38a5e653101;hp=23648bb980e4dc5368a691f2bde2bade658e3179;hpb=9f6a78629aad1d22dc8b928860fd05eb40f07352;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/databases/mariadb_replication.nix b/modules/private/databases/mariadb_replication.nix index 23648bb..52a34d3 100644 --- a/modules/private/databases/mariadb_replication.nix +++ b/modules/private/databases/mariadb_replication.nix @@ -114,6 +114,17 @@ in password = ${hcfg.dumpPassword} ''; } + { + dest = "mysql_replication/${name}/client"; + permissions = "0400"; + user = "mysql"; + group = "mysql"; + text = '' + [client] + user = ${hcfg.dumpUser} + password = ${hcfg.dumpPassword} + ''; + } ]) cfg.hosts); services.cron = { @@ -136,7 +147,7 @@ in --all-databases > ${backupDir}/$(${pkgs.coreutils}/bin/date -Iseconds).sql ''; u = pkgs.callPackage ./utils.nix {}; - cleanup_script = pkgs.writeScript "cleanup_mysql_${name}" (u.exponentialDumps backupDir); + cleanup_script = pkgs.writeScript "cleanup_mysql_${name}" (u.exponentialDumps "sql" backupDir); in [ "0 22,4,10,16 * * * root ${backup_script}" "0 3 * * * root ${cleanup_script}"